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