1- 'use strict' ;
1+ 'use strict'
22
3- var test = require ( 'tape' ) ;
4- var remark = require ( 'remark' ) ;
5- var definitions = require ( '.' ) ;
3+ var test = require ( 'tape' )
4+ var remark = require ( 'remark' )
5+ var definitions = require ( '.' )
66
7- test ( 'mdast-util-definitions' , function ( t ) {
8- var getDefinition ;
9- var tree ;
7+ test ( 'mdast-util-definitions' , function ( t ) {
8+ var getDefinition
9+ var tree
1010
1111 t . throws (
12- function ( ) {
13- definitions ( ) ;
12+ function ( ) {
13+ definitions ( )
1414 } ,
1515 / m d a s t - u t i l - d e f i n i t i o n s e x p e c t e d n o d e / ,
1616 'should fail without node'
17- ) ;
17+ )
1818
19- tree = remark ( ) . parse ( '[example]: http://example.com "Example"' ) ;
20- getDefinition = definitions ( tree ) ;
19+ tree = remark ( ) . parse ( '[example]: http://example.com "Example"' )
20+ getDefinition = definitions ( tree )
2121
2222 t . deepEqual (
2323 getDefinition ( 'example' ) ,
@@ -33,16 +33,12 @@ test('mdast-util-definitions', function (t) {
3333 }
3434 } ,
3535 'should return a definition'
36- ) ;
36+ )
3737
38- t . equal (
39- getDefinition ( 'foo' ) ,
40- null ,
41- 'should return null when not found'
42- ) ;
38+ t . equal ( getDefinition ( 'foo' ) , null , 'should return null when not found' )
4339
44- tree = remark ( ) . parse ( '[__proto__]: http://proto.com "Proto"' ) ;
45- getDefinition = definitions ( tree ) ;
40+ tree = remark ( ) . parse ( '[__proto__]: http://proto.com "Proto"' )
41+ getDefinition = definitions ( tree )
4642
4743 t . deepEqual (
4844 getDefinition ( '__proto__' ) ,
@@ -58,30 +54,27 @@ test('mdast-util-definitions', function (t) {
5854 }
5955 } ,
6056 'should work on weird identifiers'
61- ) ;
57+ )
6258
6359 t . deepEqual (
6460 getDefinition ( 'toString' ) ,
6561 null ,
6662 'should work on weird identifiers when not found'
67- ) ;
63+ )
6864
69- tree = remark ( ) . parse ( [
70- '[example]: http://one.com' ,
71- '[example]: http://two.com'
72- ] . join ( '\n' ) ) ;
65+ tree = remark ( ) . parse ( '[example]: http://one.com\n[example]: http://two.com' )
7366
7467 t . deepEqual (
7568 definitions ( tree ) ( 'example' ) . url ,
7669 'http://two.com' ,
7770 'should prefer the last of duplicate definitions by default'
78- ) ;
71+ )
7972
8073 t . deepEqual (
8174 definitions ( tree , { commonmark : true } ) ( 'example' ) . url ,
8275 'http://one.com' ,
8376 'should prefer the first of duplicate definitions in commonmark mode'
84- ) ;
77+ )
8578
86- t . end ( ) ;
87- } ) ;
79+ t . end ( )
80+ } )
0 commit comments