File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1
- import { remark } from 'remark'
2
- import find from './index.js'
1
+ var remark = require ( 'remark' )
2
+ var find = require ( './index.js' )
3
3
4
4
remark ( )
5
5
. use ( function ( ) {
Original file line number Diff line number Diff line change 15
15
* Finds first node for which function returns true when passed node as argument.
16
16
*/
17
17
18
- import { visit } from 'unist-util-visit'
19
- import iteratee from 'lodash.iteratee'
18
+ var visit = require ( 'unist-util-visit' )
19
+ var iteratee = require ( 'lodash.iteratee' )
20
20
21
21
/**
22
22
* Unist node finder utility.
@@ -29,7 +29,7 @@ import iteratee from 'lodash.iteratee'
29
29
* The first node that matches condition, or undefined if no node matches.
30
30
* @type {<V extends Node>(tree: Node, condition: TestStr | TestObj | TestFn) => V | undefined }
31
31
*/
32
- function find ( tree , condition ) {
32
+ module . exports = function find ( tree , condition ) {
33
33
if ( ! tree ) throw new Error ( 'unist-util-find requires a tree to search' )
34
34
if ( ! condition ) throw new Error ( 'unist-util-find requires a condition' )
35
35
@@ -45,5 +45,3 @@ function find (tree, condition) {
45
45
46
46
return result
47
47
}
48
-
49
- export default find
Original file line number Diff line number Diff line change 19
19
"engines" : {
20
20
"node" : " ^12.20.0 || ^14.13.1 || >=16.0.0"
21
21
},
22
- "type" : " module " ,
22
+ "type" : " commonjs " ,
23
23
"keywords" : [
24
24
" unist" ,
25
25
" remark" ,
37
37
"@types/lodash.iteratee" : " ^4.7.7" ,
38
38
"@types/unist" : " ^2.0.6" ,
39
39
"release-it" : " ^15.11.0" ,
40
- "remark" : " ^14 .0.1 " ,
41
- "standard" : " ^16 .0.4 " ,
40
+ "remark" : " ^13 .0.0 " ,
41
+ "standard" : " ^8 .0.0 " ,
42
42
"tape" : " ^5.3.1" ,
43
43
"typescript" : " ^4.6.4"
44
44
},
45
45
"dependencies" : {
46
46
"lodash.iteratee" : " ^4.7.0" ,
47
- "unist-util-visit" : " ^4.1 .0"
47
+ "unist-util-visit" : " ^2.0 .0"
48
48
}
49
49
}
Original file line number Diff line number Diff line change 1
- import test from 'tape'
2
- import { remark } from 'remark'
3
- import find from './index.js'
1
+ var test = require ( 'tape' )
2
+ var remark = require ( 'remark' )
3
+ var find = require ( './index.js' )
4
4
5
5
test ( 'unist-find' , function ( t ) {
6
6
const tree = remark ( ) . parse ( 'Some _emphasis_, **strongness**, and `code`.' )
You can’t perform that action at this time.
0 commit comments