4
4
*
5
5
* @typedef {string } Type
6
6
* @typedef {Object<string, unknown> } Props
7
+ *
8
+ * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything> } Test
7
9
*/
8
10
9
11
/**
@@ -53,7 +55,7 @@ export var is =
53
55
*
54
56
* @type {(
55
57
* (<T extends Node>(node: unknown, test: T['type']|Partial<T>|TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|TestFunctionPredicate<T>>, index?: number, parent?: Parent, context?: unknown) => node is T) &
56
- * ((node?: unknown, test?: null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything> , index?: number, parent?: Parent, context?: unknown) => boolean)
58
+ * ((node?: unknown, test?: Test , index?: number, parent?: Parent, context?: unknown) => boolean)
57
59
* )}
58
60
*/
59
61
(
@@ -62,7 +64,7 @@ export var is =
62
64
* When a `parent` node is known the `index` of node should also be given.
63
65
*
64
66
* @param {unknown } [node] Node to check
65
- * @param {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything> } [test]
67
+ * @param {Test } [test]
66
68
* When nullish, checks if `node` is a `Node`.
67
69
* When `string`, works like passing `function (node) {return node.type === test}`.
68
70
* When `function` checks if function passed the node is true.
@@ -113,13 +115,13 @@ export var convert =
113
115
/**
114
116
* @type {(
115
117
* (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) &
116
- * ((test?: null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything> ) => AssertAnything)
118
+ * ((test?: Test ) => AssertAnything)
117
119
* )}
118
120
*/
119
121
(
120
122
/**
121
123
* Generate an assertion from a check.
122
- * @param {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything> } [test]
124
+ * @param {Test } [test]
123
125
* When nullish, checks if `node` is a `Node`.
124
126
* When `string`, works like passing `function (node) {return node.type === test}`.
125
127
* When `function` checks if function passed the node is true.
0 commit comments