diff --git a/index.js b/index.js index 33d18bc..d67769b 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,8 @@ * * @typedef {string} Type * @typedef {Object} Props + * + * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test */ /** @@ -53,7 +55,7 @@ export var is = * * @type {( * ((node: unknown, test: T['type']|Partial|TestFunctionPredicate|Array.|TestFunctionPredicate>, index?: number, parent?: Parent, context?: unknown) => node is T) & - * ((node?: unknown, test?: null|undefined|Type|Props|TestFunctionAnything|Array., index?: number, parent?: Parent, context?: unknown) => boolean) + * ((node?: unknown, test?: Test, index?: number, parent?: Parent, context?: unknown) => boolean) * )} */ ( @@ -62,7 +64,7 @@ export var is = * When a `parent` node is known the `index` of node should also be given. * * @param {unknown} [node] Node to check - * @param {null|undefined|Type|Props|TestFunctionAnything|Array.} [test] + * @param {Test} [test] * When nullish, checks if `node` is a `Node`. * When `string`, works like passing `function (node) {return node.type === test}`. * When `function` checks if function passed the node is true. @@ -113,13 +115,13 @@ export var convert = /** * @type {( * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) & - * ((test?: null|undefined|Type|Props|TestFunctionAnything|Array.) => AssertAnything) + * ((test?: Test) => AssertAnything) * )} */ ( /** * Generate an assertion from a check. - * @param {null|undefined|Type|Props|TestFunctionAnything|Array.} [test] + * @param {Test} [test] * When nullish, checks if `node` is a `Node`. * When `string`, works like passing `function (node) {return node.type === test}`. * When `function` checks if function passed the node is true.