unist-util-is
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -7,2 +7,4 @@ /** | ||
* @typedef {Object<string, unknown>} Props | ||
* | ||
* @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test | ||
*/ | ||
@@ -58,9 +60,3 @@ /** | ||
node?: unknown, | ||
test?: | ||
| null | ||
| undefined | ||
| Type | ||
| Props | ||
| TestFunctionAnything | ||
| Array<Type | Props | TestFunctionAnything>, | ||
test?: Test, | ||
index?: number, | ||
@@ -73,11 +69,3 @@ parent?: Parent, | ||
) => AssertPredicate<T>) & | ||
(( | ||
test?: | ||
| null | ||
| undefined | ||
| Type | ||
| Props | ||
| TestFunctionAnything | ||
| Array<Type | Props | TestFunctionAnything> | ||
) => AssertAnything) | ||
((test?: Test) => AssertAnything) | ||
export type Node = import('unist').Node | ||
@@ -89,2 +77,9 @@ export type Parent = import('unist').Parent | ||
} | ||
export type Test = | ||
| null | ||
| undefined | ||
| Type | ||
| Props | ||
| TestFunctionAnything | ||
| Array<Type | Props | TestFunctionAnything> | ||
/** | ||
@@ -91,0 +86,0 @@ * Check if a node passes a test |
10
index.js
@@ -7,2 +7,4 @@ /** | ||
* @typedef {Object<string, unknown>} Props | ||
* | ||
* @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test | ||
*/ | ||
@@ -57,3 +59,3 @@ | ||
* (<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) & | ||
* ((node?: unknown, test?: null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>, index?: number, parent?: Parent, context?: unknown) => boolean) | ||
* ((node?: unknown, test?: Test, index?: number, parent?: Parent, context?: unknown) => boolean) | ||
* )} | ||
@@ -67,3 +69,3 @@ */ | ||
* @param {unknown} [node] Node to check | ||
* @param {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} [test] | ||
* @param {Test} [test] | ||
* When nullish, checks if `node` is a `Node`. | ||
@@ -119,3 +121,3 @@ * When `string`, works like passing `function (node) {return node.type === test}`. | ||
* (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & | ||
* ((test?: null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>) => AssertAnything) | ||
* ((test?: Test) => AssertAnything) | ||
* )} | ||
@@ -126,3 +128,3 @@ */ | ||
* Generate an assertion from a check. | ||
* @param {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} [test] | ||
* @param {Test} [test] | ||
* When nullish, checks if `node` is a `Node`. | ||
@@ -129,0 +131,0 @@ * When `string`, works like passing `function (node) {return node.type === test}`. |
{ | ||
"name": "unist-util-is", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "unist utility to check if a node passes a test", | ||
@@ -55,3 +55,3 @@ "license": "MIT", | ||
"unified": "^9.0.0", | ||
"xo": "^0.38.0" | ||
"xo": "^0.39.0" | ||
}, | ||
@@ -58,0 +58,0 @@ "scripts": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
18293
330