1- # unist-util-find -all-between
1+ # unist-util-replace -all-between
22
33[ ** unist** ] ( https://github.com/syntax-tree/unist ) utility to modify an existing child list to replace all elements between all
44instances of two nodes
@@ -8,14 +8,14 @@ instances of two nodes
88[ npm] ( https://docs.npmjs.com/cli/install ) :
99
1010``` sh
11- npm install unist-util-find -all-between
11+ npm install unist-util-replace -all-between
1212```
1313
1414## Usage
1515
1616``` js
1717import u from ' unist-builder'
18- import findAllBetween from ' unist-util-find -all-between'
18+ import replaceAllBetween from ' unist-util-replace -all-between'
1919
2020const tree = u (' root' , [
2121 u (' start' , ' 1' ),
@@ -27,7 +27,7 @@ const tree = u('root', [
2727 u (' end' , ' 4' ),
2828])
2929
30- const newChildren = findAllBetween (tree, {type: ' start' }, {type: ' end' }, () => [u (' replaced' , ' 1' )])
30+ const newChildren = replaceAllBetween (tree, {type: ' start' }, {type: ' end' }, () => [u (' replaced' , ' 1' )])
3131
3232console .dir (newChildren, {depth: null })
3333```
@@ -44,7 +44,7 @@ Yields:
4444
4545## API
4646
47- ### ` findAllBetween (parent, start, end, func)`
47+ ### ` replaceAllBetween (parent, start, end, func)`
4848
4949Mutate an existing parent's children to reflect function return
5050
0 commit comments