File tree Expand file tree Collapse file tree 6 files changed +23
-35
lines changed Expand file tree Collapse file tree 6 files changed +23
-35
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
* .log
3
- .nyc_output /
4
3
coverage /
5
4
node_modules /
6
- hast-util-transparent.js
7
- hast-util-transparent.min.js
8
5
yarn.lock
Original file line number Diff line number Diff line change 1
1
coverage /
2
- hast-util-transparent.js
3
- hast-util-transparent.min.js
4
- * .json
5
2
* .md
Original file line number Diff line number Diff line change 1
- 'use strict '
1
+ import { convertElement } from 'hast-util-is-element '
2
2
3
- var convert = require ( 'hast-util-is-element/convert' )
4
-
5
- module . exports = convert ( [
3
+ export const transparent = convertElement ( [
6
4
'a' ,
7
5
'audio' ,
8
6
'canvas' ,
Original file line number Diff line number Diff line change 23
23
"contributors" : [
24
24
" Titus Wormer <[email protected] > (https://wooorm.com)"
25
25
],
26
+ "sideEffects" : false ,
27
+ "type" : " module" ,
28
+ "main" : " index.js" ,
26
29
"files" : [
27
30
" index.js"
28
31
],
29
32
"dependencies" : {
30
- "hast-util-is-element" : " ^1.1 .0"
33
+ "hast-util-is-element" : " ^2.0 .0"
31
34
},
32
35
"devDependencies" : {
33
- "browserify" : " ^17.0.0" ,
34
- "nyc" : " ^15.0.0" ,
36
+ "c8" : " ^7.0.0" ,
35
37
"prettier" : " ^2.0.0" ,
36
38
"remark-cli" : " ^9.0.0" ,
37
39
"remark-preset-wooorm" : " ^8.0.0" ,
38
40
"tape" : " ^5.0.0" ,
39
- "tinyify" : " ^3.0.0" ,
40
- "xo" : " ^0.38.0"
41
+ "xo" : " ^0.39.0"
41
42
},
42
43
"scripts" : {
43
44
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
44
- "build-bundle" : " browserify . -s hastUtilTransparent -o hast-util-transparent.js" ,
45
- "build-mangle" : " browserify . -s hastUtilTransparent -o hast-util-transparent.min.js -p tinyify" ,
46
- "build" : " npm run build-bundle && npm run build-mangle" ,
47
- "test-api" : " node test" ,
48
- "test-coverage" : " nyc --reporter lcov tape test.js" ,
49
- "test" : " npm run format && npm run build && npm run test-coverage"
45
+ "test-api" : " node test.js" ,
46
+ "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
47
+ "test" : " npm run format && npm run test-coverage"
50
48
},
51
49
"prettier" : {
52
50
"tabWidth" : 2 ,
58
56
},
59
57
"xo" : {
60
58
"prettier" : true ,
61
- "esnext" : false ,
62
- "ignores" : [
63
- " hast-util-transparent.js"
64
- ]
65
- },
66
- "nyc" : {
67
- "check-coverage" : true ,
68
- "lines" : 100 ,
69
- "functions" : 100 ,
70
- "branches" : 100
59
+ "rules" : {
60
+ "no-var" : " off" ,
61
+ "prefer-arrow-callback" : " off"
62
+ }
71
63
},
72
64
"remarkConfig" : {
73
65
"plugins" : [
Original file line number Diff line number Diff line change 13
13
14
14
## Install
15
15
16
+ This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
17
+ Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
18
+
16
19
[ npm] [ ] :
17
20
18
21
``` sh
@@ -40,6 +43,9 @@ transparent({
40
43
41
44
## API
42
45
46
+ This package exports the following identifiers: ` transparent ` .
47
+ There is no default export.
48
+
43
49
### ` transparent(node) `
44
50
45
51
Check if the given value is a [ * transparent* ] [ spec ] [ * element* ] [ element ] .
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- var test = require ( 'tape' )
4
- var transparent = require ( '.' )
1
+ import test from 'tape'
2
+ import { transparent } from './index.js'
5
3
6
4
test ( 'transparent' , function ( t ) {
7
5
t . equal ( transparent ( ) , false , 'should return `false` without node' )
You can’t perform that action at this time.
0 commit comments