3
3
* @typedef {import('unist').Parent } UnistParent
4
4
* @typedef {import('unist-util-assert').AssertionError } AssertionError
5
5
*
6
+ * @typedef {import('nlcst').Nodes } Nodes
7
+ * @typedef {import('nlcst').Parents } Parents
6
8
* @typedef {import('nlcst').Root } Root
7
- * @typedef {import('nlcst').Content } Content
8
- */
9
-
10
- /**
11
- * @typedef {Root | Content } Node
12
- * @typedef {Extract<Node, UnistParent> } Parent
13
9
*/
14
10
15
11
import nodeAssert from 'node:assert'
@@ -33,7 +29,7 @@ import {
33
29
* Thing to assert.
34
30
* @param {UnistParent | null | undefined } [parent]
35
31
* Optional, valid parent.
36
- * @returns {asserts tree is Node }
32
+ * @returns {asserts tree is Nodes }
37
33
* Nothing.
38
34
* @throws {AssertionError }
39
35
* When `tree` (or its descendants) is not a nlcst node.
@@ -53,7 +49,7 @@ export function assert(tree, parent) {
53
49
* Thing to assert.
54
50
* @param {UnistParent | null | undefined } [parent]
55
51
* Optional, valid parent.
56
- * @returns {asserts tree is Parent }
52
+ * @returns {asserts tree is Parents }
57
53
* Nothing.
58
54
* @throws {AssertionError }
59
55
* When `tree` is not a parent or its descendants are not nodes.
@@ -107,7 +103,7 @@ function unknown(node, parent) {
107
103
*
108
104
* @param {unknown } [tree]
109
105
* Thing to assert.
110
- * @returns {asserts tree is Parent }
106
+ * @returns {asserts tree is Parents }
111
107
* Nothing.
112
108
* @throws {AssertionError }
113
109
* When `tree` is not a parent or its descendants are not nodes.
0 commit comments