You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// this node will be removed as well because of `opts.cascade`.
33
+
u('node', [
34
+
u('leaf', 5),
35
+
])
36
+
]),
37
+
u('leaf', 6)
38
+
]);
39
+
40
+
// Remove all nodes of type `leaf`.
41
+
remove(ast, 'leaf')
42
+
//=> root[1]
43
+
// └─ node[1]
44
+
// └─ node[1]
45
+
// └─ other: "4"
70
46
```
71
47
72
48
If the root node gets removed, the entire tree is destroyed and `remove` returns `null`. That's the only case in which `remove` doesn't return the original root node.
0 commit comments