@@ -18,7 +18,7 @@ Modify direct children of a parent.
18
18
npm install unist-util-modify-children
19
19
```
20
20
21
- ## Usage
21
+ ## Use
22
22
23
23
``` js
24
24
var u = require (' unist-builder' )
@@ -50,9 +50,9 @@ Yields:
50
50
{
51
51
type: ' root' ,
52
52
children: [
53
- { type: ' leaf' , value: ' 1' },
54
- { type: ' subtree' , children: [ { type: ' leaf' , value: ' 2' } ] },
55
- { type: ' leaf' , value: ' 3' }
53
+ {type: ' leaf' , value: ' 1' },
54
+ {type: ' subtree' , children: [{ type: ' leaf' , value: ' 2' }] },
55
+ {type: ' leaf' , value: ' 3' }
56
56
]
57
57
}
58
58
```
@@ -81,16 +81,29 @@ Invoke the bound [`modifier`][modifier] for each child in `parent`
81
81
## Related
82
82
83
83
* [ ` unist-util-visit ` ] ( https://github.com/syntax-tree/unist-util-visit )
84
- — Visit nodes
84
+ — Recursively walk over nodes
85
85
* [ ` unist-util-visit-parents ` ] ( https://github.com/syntax-tree/unist-util-visit-parents )
86
- — Visit nodes with ancestral information
87
- * [ ` unist-util-filter ` ] ( https://github.com/eush77 /unist-util-filter )
86
+ — Like ` visit ` , but with a stack of parents
87
+ * [ ` unist-util-filter ` ] ( https://github.com/syntax-tree /unist-util-filter )
88
88
— Create a new tree with all nodes that pass a test
89
89
* [ ` unist-util-map ` ] ( https://github.com/syntax-tree/unist-util-map )
90
90
— Create a new tree with all nodes mapped by a given function
91
- * [ ` unist-util-remove ` ] ( https://github.com/eush77/unist-util-remove )
91
+ * [ ` unist-util-flatmap ` ] ( https://gitlab.com/staltz/unist-util-flatmap )
92
+ — Create a new tree by mapping (to an array) with the provided function and
93
+ then flattening
94
+ * [ ` unist-util-find-after ` ] ( https://github.com/syntax-tree/unist-util-find-after )
95
+ — Find a node after another node
96
+ * [ ` unist-util-find-before ` ] ( https://github.com/syntax-tree/unist-util-find-before )
97
+ — Find a node before another node
98
+ * [ ` unist-util-find-all-after ` ] ( https://github.com/syntax-tree/unist-util-find-all-after )
99
+ — Find all nodes after another node
100
+ * [ ` unist-util-find-all-before ` ] ( https://github.com/syntax-tree/unist-util-find-all-before )
101
+ — Find all nodes before another node
102
+ * [ ` unist-util-find-all-between ` ] ( https://github.com/mrzmmr/unist-util-find-all-between )
103
+ — Find all nodes between two nodes
104
+ * [ ` unist-util-remove ` ] ( https://github.com/syntax-tree/unist-util-remove )
92
105
— Remove nodes from a tree that pass a test
93
- * [ ` unist-util-select ` ] ( https://github.com/eush77 /unist-util-select )
106
+ * [ ` unist-util-select ` ] ( https://github.com/syntax-tree /unist-util-select )
94
107
— Select nodes with CSS-like selectors
95
108
96
109
## Contribute
@@ -99,8 +112,8 @@ See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
99
112
started.
100
113
See [ ` support.md ` ] [ support ] for ways to get help.
101
114
102
- This project has a [ Code of Conduct ] [ coc ] .
103
- By interacting with this repository, organisation , or community you agree to
115
+ This project has a [ code of conduct ] [ coc ] .
116
+ By interacting with this repository, organization , or community you agree to
104
117
abide by its terms.
105
118
106
119
## License
@@ -131,7 +144,7 @@ abide by its terms.
131
144
132
145
[ collective ] : https://opencollective.com/unified
133
146
134
- [ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum -7b16ff.svg
147
+ [ chat-badge ] : https://img.shields.io/badge/chat-spectrum -7b16ff.svg
135
148
136
149
[ chat ] : https://spectrum.chat/unified/syntax-tree
137
150
0 commit comments