File tree Expand file tree Collapse file tree 5 files changed +36
-38
lines changed Expand file tree Collapse file tree 5 files changed +36
-38
lines changed Original file line number Diff line number Diff line change
1
+ coverage /
Original file line number Diff line number Diff line change 1
- 'use strict' ;
1
+ 'use strict'
2
2
3
- var is = require ( 'unist-util-is' ) ;
3
+ var is = require ( 'unist-util-is' )
4
4
5
- module . exports = isPhrasing ;
5
+ module . exports = isPhrasing
6
6
7
7
var phrasing = [
8
8
'inlineCode' ,
@@ -17,9 +17,9 @@ var phrasing = [
17
17
'imageReference' ,
18
18
'footnoteReference' ,
19
19
'text'
20
- ] ;
20
+ ]
21
21
22
22
/* Check if a node is a phrasing element */
23
23
function isPhrasing ( node ) {
24
- return is ( phrasing , node ) ;
24
+ return is ( phrasing , node )
25
25
}
Original file line number Diff line number Diff line change 23
23
"unist-util-is" : " ^2.1.1"
24
24
},
25
25
"devDependencies" : {
26
+ "nyc" : " ^13.0.0" ,
27
+ "prettier" : " ^1.14.3" ,
26
28
"remark-cli" : " ^6.0.0" ,
27
29
"remark-preset-wooorm" : " ^4.0.0" ,
28
- "nyc" : " ^13.0.0" ,
29
30
"tape" : " ^4.4.0" ,
30
31
"xo" : " ^0.23.0"
31
32
},
32
33
"scripts" : {
33
- "build-md" : " remark . --quiet --frail --output" ,
34
- "build" : " npm run build-md" ,
35
- "lint" : " xo" ,
36
- "test-api" : " node test.js" ,
34
+ "format" : " remark . -qfo && prettier --write '**/*.js' && xo --fix" ,
35
+ "test-api" : " node test" ,
37
36
"test-coverage" : " nyc --reporter lcov tape test.js" ,
38
- "pretest" : " npm run lint" ,
39
- "test" : " node test" ,
40
- "posttest" : " npm run test-coverage"
37
+ "test" : " npm run format && npm run test-coverage"
41
38
},
42
39
"nyc" : {
43
40
"check-coverage" : true ,
44
41
"lines" : 100 ,
45
42
"functions" : 100 ,
46
43
"branches" : 100
47
44
},
45
+ "prettier" : {
46
+ "tabWidth" : 2 ,
47
+ "useTabs" : false ,
48
+ "singleQuote" : true ,
49
+ "bracketSpacing" : false ,
50
+ "semi" : false ,
51
+ "trailingComma" : " none"
52
+ },
48
53
"xo" : {
49
- "space " : true ,
54
+ "prettier " : true ,
50
55
"esnext" : false ,
51
56
"rules" : {
52
57
"no-multi-assign" : " off"
Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ npm install mdast-util-phrasing
13
13
## Usage
14
14
15
15
``` javascript
16
- var phrasing = require (' mdast-util-phrasing' );
16
+ var phrasing = require (' mdast-util-phrasing' )
17
17
18
18
phrasing ({
19
19
type: ' paragraph' ,
20
20
children: [{type: ' text' , value: ' Alpha' }]
21
- }); // => false
21
+ }) // => false
22
22
23
23
phrasing ({
24
24
type: ' strong' ,
25
25
children: [{type: ' text' , value: ' Delta' }]
26
- }); // => true
26
+ }) // => true
27
27
```
28
28
29
29
## API
Original file line number Diff line number Diff line change 1
- 'use strict' ;
1
+ 'use strict'
2
2
3
- var test = require ( 'tape' ) ;
4
- var phrasing = require ( '.' ) ;
3
+ var test = require ( 'tape' )
4
+ var phrasing = require ( '.' )
5
5
6
- test ( 'phrasing' , function ( t ) {
7
- t . equal (
8
- phrasing ( ) ,
9
- false ,
10
- 'should return `false` without node'
11
- ) ;
6
+ test ( 'phrasing' , function ( t ) {
7
+ t . equal ( phrasing ( ) , false , 'should return `false` without node' )
12
8
13
- t . equal (
14
- phrasing ( null ) ,
15
- false ,
16
- 'should return `false` with `null`'
17
- ) ;
9
+ t . equal ( phrasing ( null ) , false , 'should return `false` with `null`' )
18
10
19
11
t . equal (
20
12
phrasing ( { type : 'foo' } ) ,
21
13
false ,
22
14
'should return `false` when without known `node`'
23
- ) ;
15
+ )
24
16
25
17
t . equal (
26
18
phrasing ( { type : 'link' } ) ,
27
19
true ,
28
20
'should return `true` when with a phrasing `node`'
29
- ) ;
21
+ )
30
22
31
23
t . equal (
32
24
phrasing ( { type : 'strong' } ) ,
33
25
true ,
34
26
'should return `true` when with another phrasing `node`'
35
- ) ;
27
+ )
36
28
37
29
t . equal (
38
30
phrasing ( { type : 'paragraph' } ) ,
39
31
false ,
40
32
'should return `false` when with a block `node`'
41
- ) ;
33
+ )
42
34
43
35
t . equal (
44
36
phrasing ( { type : 'list' } ) ,
45
37
false ,
46
38
'should return `false` when with another block `node`'
47
- ) ;
39
+ )
48
40
49
- t . end ( ) ;
50
- } ) ;
41
+ t . end ( )
42
+ } )
You can’t perform that action at this time.
0 commit comments