File tree 1 file changed +13
-9
lines changed 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,22 @@ import {visit} from 'unist-util-visit'
8
8
* Remove the `position` field from a tree.
9
9
*
10
10
* @template {Node} Tree
11
- * @param {Tree } node
12
- * The unist tree.
13
- * @param {boolean } [force=false]
14
- * If `force` is given (`boolean`, default: `false`), uses `delete` to remove
15
- * the field entirely, otherwise it’s set to `undefined`.
11
+ * Node type.
12
+ * @param {Tree } tree
13
+ * Tree to clean.
14
+ * @param {boolean | null | undefined } [force=false]
15
+ * Whether to use `delete` to remove `position` fields.
16
+ *
17
+ * The default is to set them to `undefined`.
16
18
* @returns {Tree }
17
- * The given, modified, `node `.
19
+ * The given, modified, `tree `.
18
20
*/
19
- export function removePosition ( node , force ) {
20
- visit ( node , remove )
21
+ // To do: next major: return `void`.
22
+ // To do: remove `force` shortcut, replace with options.
23
+ export function removePosition ( tree , force ) {
24
+ visit ( tree , remove )
21
25
22
- return node
26
+ return tree
23
27
24
28
/**
25
29
* @param {Node } node
You can’t perform that action at this time.
0 commit comments