File tree Expand file tree Collapse file tree 6 files changed +21
-35
lines changed Expand file tree Collapse file tree 6 files changed +21
-35
lines changed Original file line number Diff line number Diff line change 11.DS_Store
22* .log
3- .nyc_output /
43coverage /
54node_modules /
6- unist-util-generated.js
7- unist-util-generated.min.js
85yarn.lock
Original file line number Diff line number Diff line change 11coverage /
2- unist-util-generated.js
3- unist-util-generated.min.js
4- * .json
52* .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 ) {
62 return (
73 ! node ||
84 ! node . position ||
Original file line number Diff line number Diff line change 2222 "contributors" : [
2323 " Titus Wormer <[email protected] > (https://wooorm.com)" 2424 ],
25+ "sideEffects" : false ,
26+ "type" : " module" ,
27+ "main" : " index.js" ,
2528 "files" : [
2629 " index.js"
2730 ],
2831 "devDependencies" : {
29- "browserify" : " ^17.0.0" ,
30- "nyc" : " ^15.0.0" ,
32+ "c8" : " ^7.0.0" ,
3133 "prettier" : " ^2.0.0" ,
3234 "remark-cli" : " ^9.0.0" ,
3335 "remark-preset-wooorm" : " ^8.0.0" ,
3436 "tape" : " ^5.0.0" ,
35- "tinyify" : " ^3.0.0" ,
3637 "xo" : " ^0.38.0"
3738 },
3839 "scripts" : {
3940 "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"
5244 },
5345 "prettier" : {
5446 "tabWidth" : 2 ,
6052 },
6153 "xo" : {
6254 "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+ }
6759 },
6860 "remarkConfig" : {
6961 "plugins" : [
Original file line number Diff line number Diff line change 1212
1313## Install
1414
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+
1518[ npm] [ ] :
1619
1720``` sh
@@ -21,7 +24,7 @@ npm install unist-util-generated
2124## Use
2225
2326``` js
24- var generated = require ( ' unist-util-generated' )
27+ import { generated } from ' unist-util-generated'
2528
2629generated ({}) // => true
2730
@@ -34,6 +37,9 @@ generated({
3437
3538## API
3639
40+ This package exports the following identifiers: ` generated ` .
41+ There is no default export.
42+
3743### ` generated(node) `
3844
3945Check 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'
53
64test ( 'generated' , function ( t ) {
75 t . equal ( generated ( ) , true , 'should not throw without node' )
You can’t perform that action at this time.
0 commit comments