File tree 6 files changed +24
-29
lines changed 6 files changed +24
-29
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
5
yarn.lock
Original file line number Diff line number Diff line change 1
1
coverage /
2
- * .json
3
2
* .md
Original file line number Diff line number Diff line change 1
- 'use strict '
1
+ import { remove } from 'unist-util-remove '
2
2
3
- var remove = require ( 'unist-util-remove' )
4
-
5
- module . exports = squeeze
6
-
7
- function squeeze ( tree ) {
3
+ export function squeezeParagraphs ( tree ) {
8
4
return remove ( tree , { cascade : false } , isEmptyParagraph )
9
5
}
10
6
Original file line number Diff line number Diff line change 30
30
" Eugene Sharygin <eush77@gmail.com>" ,
31
31
" Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
32
32
],
33
+ "sideEffects" : false ,
34
+ "type" : " module" ,
35
+ "main" : " index.js" ,
33
36
"files" : [
34
37
" index.js"
35
38
],
36
39
"dependencies" : {
37
- "unist-util-remove" : " ^2 .0.0"
40
+ "unist-util-remove" : " ^3 .0.0"
38
41
},
39
42
"devDependencies" : {
40
- "nyc " : " ^15 .0.0" ,
43
+ "c8 " : " ^7 .0.0" ,
41
44
"prettier" : " ^2.0.0" ,
42
45
"remark-cli" : " ^9.0.0" ,
43
46
"remark-preset-wooorm" : " ^8.0.0" ,
44
47
"tape" : " ^5.0.0" ,
45
- "unist-builder" : " ^2 .0.0" ,
46
- "xo" : " ^0.38 .0"
48
+ "unist-builder" : " ^3 .0.0" ,
49
+ "xo" : " ^0.39 .0"
47
50
},
48
51
"scripts" : {
49
52
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
50
- "test-api" : " node test" ,
51
- "test-coverage" : " nyc --reporter lcov tape test.js" ,
53
+ "test-api" : " node test.js " ,
54
+ "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 -- reporter lcov node test.js" ,
52
55
"test" : " npm run format && npm run test-coverage"
53
56
},
54
- "nyc" : {
55
- "check-coverage" : true ,
56
- "lines" : 100 ,
57
- "functions" : 100 ,
58
- "branches" : 100
59
- },
60
57
"prettier" : {
61
58
"tabWidth" : 2 ,
62
59
"useTabs" : false ,
67
64
},
68
65
"xo" : {
69
66
"prettier" : true ,
70
- "esnext" : false ,
71
67
"rules" : {
72
- "unicorn/no-fn-reference-in-iterator" : " off"
68
+ "no-var" : " off" ,
69
+ "prefer-arrow-callback" : " off"
73
70
}
74
71
},
75
72
"remarkConfig" : {
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ characters.
15
15
16
16
## Install
17
17
18
+ This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
19
+ Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
20
+
18
21
[ npm] [ ] :
19
22
20
23
``` sh
@@ -24,8 +27,8 @@ npm install mdast-squeeze-paragraphs
24
27
## Use
25
28
26
29
``` js
27
- var u = require ( ' unist-builder' )
28
- var squeezeParagraphs = require ( ' mdast-squeeze-paragraphs' )
30
+ import { u } from ' unist-builder'
31
+ import { squeezeParagraphs } from ' mdast-squeeze-paragraphs'
29
32
30
33
var tree = u (' root' , [
31
34
u (' paragraph' , []),
@@ -49,6 +52,9 @@ Yields:
49
52
50
53
## API
51
54
55
+ This package exports the following identifiers: ` squeezeParagraphs ` .
56
+ There is no default export.
57
+
52
58
### ` squeezeParagraphs(tree) `
53
59
54
60
Modifies [ tree] [ ] in-place.
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- var test = require ( 'tape' )
4
- var u = require ( 'unist-builder' )
5
- var squeezeParagraphs = require ( '.' )
1
+ import test from 'tape'
2
+ import { u } from 'unist-builder'
3
+ import { squeezeParagraphs } from './index.js'
6
4
7
5
test ( function ( t ) {
8
6
t . deepEqual (
You can’t perform that action at this time.
0 commit comments