File tree Expand file tree Collapse file tree 6 files changed +24
-42
lines changed Expand file tree Collapse file tree 6 files changed +24
-42
lines changed Original file line number Diff line number Diff line change 11.DS_Store
22* .log
33coverage /
4- .nyc_output /
54node_modules /
6- hast-util-script-supporting.js
7- hast-util-script-supporting.min.js
85yarn.lock
Original file line number Diff line number Diff line change 11coverage /
2- hast-util-script-supporting.js
3- hast-util-script-supporting.min.js
4- * .json
52* .md
Original file line number Diff line number Diff line change 1- 'use strict'
2-
3- module . exports = scriptSupporting
4-
5- var is = require ( 'hast-util-is-element' )
6-
7- var names = [ 'script' , 'template' ]
1+ import { convertElement } from 'hast-util-is-element'
82
93/* Check if a node is a script-supporting element */
10- function scriptSupporting ( node ) {
11- return is ( node , names )
12- }
4+ export const scriptSupporting = convertElement ( [ 'script' , 'template' ] )
Original file line number Diff line number Diff line change 2424 "contributors" : [
2525 " Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
2626 ],
27+ "sideEffects" : false ,
28+ "type" : " module" ,
29+ "main" : " index.js" ,
2730 "files" : [
2831 " index.js"
2932 ],
3033 "dependencies" : {
31- "hast-util-is-element" : " ^1 .0.0"
34+ "hast-util-is-element" : " ^2 .0.0"
3235 },
3336 "devDependencies" : {
34- "browserify" : " ^17.0.0" ,
35- "nyc" : " ^15.0.0" ,
37+ "c8" : " ^7.0.0" ,
3638 "prettier" : " ^2.0.0" ,
3739 "remark-cli" : " ^9.0.0" ,
3840 "remark-preset-wooorm" : " ^8.0.0" ,
3941 "tape" : " ^5.0.0" ,
40- "tinyify" : " ^3.0.0" ,
41- "xo" : " ^0.38.0"
42+ "xo" : " ^0.39.0"
4243 },
4344 "scripts" : {
4445 "format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
45- "build-bundle" : " browserify . -s hastUtilScriptSupporting > hast-util-script-supporting.js" ,
46- "build-mangle" : " browserify . -s hastUtilScriptSupporting -p tinyify > hast-util-script-supporting.min.js" ,
47- "build" : " npm run build-bundle && npm run build-mangle" ,
48- "test-api" : " node test" ,
49- "test-coverage" : " nyc --reporter lcov tape test.js" ,
50- "test" : " npm run format && npm run build && npm run test-coverage"
51- },
52- "nyc" : {
53- "check-coverage" : true ,
54- "lines" : 100 ,
55- "functions" : 100 ,
56- "branches" : 100
46+ "test-api" : " node test.js" ,
47+ "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
48+ "test" : " npm run format && npm run test-coverage"
5749 },
5850 "prettier" : {
5951 "tabWidth" : 2 ,
6557 },
6658 "xo" : {
6759 "prettier" : true ,
68- "esnext " : false ,
69- "ignores " : [
70- " hast-util-script-supporting.js "
71- ]
60+ "rules " : {
61+ "no-var " : " off " ,
62+ "prefer-arrow-callback" : " off "
63+ }
7264 },
7365 "remarkConfig" : {
7466 "plugins" : [
Original file line number Diff line number Diff line change 1313
1414## Install
1515
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+
1619[ npm] [ ] :
1720
1821``` sh
@@ -22,7 +25,7 @@ npm install hast-util-script-supporting
2225## Use
2326
2427``` js
25- var scriptSupporting = require ( ' hast-util-script-supporting' )
28+ import { scriptSupporting } from ' hast-util-script-supporting'
2629
2730scriptSupporting ({
2831 type: ' element' ,
@@ -40,6 +43,9 @@ scriptSupporting({
4043
4144## API
4245
46+ This package exports the following identifiers: ` scriptSupporting ` .
47+ There is no default export.
48+
4349### ` scriptSupporting(node) `
4450
4551Check if the given value is a [ * script-supporting* ] [ spec ] [ * element* ] [ element ] .
Original file line number Diff line number Diff line change 1- 'use strict'
2-
3- var test = require ( 'tape' )
4- var scriptSupporting = require ( '.' )
1+ import test from 'tape'
2+ import { scriptSupporting } from './index.js'
53
64test ( 'scriptSupporting' , function ( t ) {
75 t . equal ( scriptSupporting ( ) , false , 'should return `false` without node' )
You can’t perform that action at this time.
0 commit comments