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' )
33
44remark ( )
55 . use ( function ( ) {
Original file line number Diff line number Diff line change 1515 * Finds first node for which function returns true when passed node as argument.
1616 */
1717
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' )
2020
2121/**
2222 * Unist node finder utility.
@@ -29,7 +29,7 @@ import iteratee from 'lodash.iteratee'
2929 * The first node that matches condition, or undefined if no node matches.
3030 * @type {<V extends Node>(tree: Node, condition: TestStr | TestObj | TestFn) => V | undefined }
3131 */
32- function find ( tree , condition ) {
32+ module . exports = function find ( tree , condition ) {
3333 if ( ! tree ) throw new Error ( 'unist-util-find requires a tree to search' )
3434 if ( ! condition ) throw new Error ( 'unist-util-find requires a condition' )
3535
@@ -45,5 +45,3 @@ function find (tree, condition) {
4545
4646 return result
4747}
48-
49- export default find
Original file line number Diff line number Diff line change 1919 "engines" : {
2020 "node" : " ^12.20.0 || ^14.13.1 || >=16.0.0"
2121 },
22- "type" : " module " ,
22+ "type" : " commonjs " ,
2323 "keywords" : [
2424 " unist" ,
2525 " remark" ,
3737 "@types/lodash.iteratee" : " ^4.7.7" ,
3838 "@types/unist" : " ^2.0.6" ,
3939 "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 " ,
4242 "tape" : " ^5.3.1" ,
4343 "typescript" : " ^4.6.4"
4444 },
4545 "dependencies" : {
4646 "lodash.iteratee" : " ^4.7.0" ,
47- "unist-util-visit" : " ^4.1 .0"
47+ "unist-util-visit" : " ^2.0 .0"
4848 }
4949}
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' )
44
55test ( 'unist-find' , function ( t ) {
66 const tree = remark ( ) . parse ( 'Some _emphasis_, **strongness**, and `code`.' )
You can’t perform that action at this time.
0 commit comments