Socket
Socket
Sign inDemoInstall

unist-util-is

Package Overview
Dependencies
0
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.1.0

27

index.d.ts

@@ -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

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc