Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hast-util-is-element

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-is-element - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

23

index.d.ts

@@ -7,2 +7,3 @@ /**

* @typedef {string} TagName
* @typedef {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} Test
*/

@@ -59,8 +60,3 @@ /**

node?: unknown,
test?:
| null
| undefined
| TagName
| TestFunctionAnything
| Array<TagName | TestFunctionAnything>,
test?: Test,
index?: number,

@@ -73,10 +69,3 @@ parent?: Parent,

) => AssertPredicate<T>) &
((
test?:
| null
| undefined
| TagName
| TestFunctionAnything
| Array<TagName | TestFunctionAnything>
) => AssertAnything)
((test?: Test) => AssertAnything)
export type Node = import('unist').Node

@@ -86,2 +75,8 @@ export type Parent = import('unist').Parent

export type TagName = string
export type Test =
| null
| undefined
| TagName
| TestFunctionAnything
| Array<TagName | TestFunctionAnything>
/**

@@ -88,0 +83,0 @@ * Check if an element passes a test

@@ -7,2 +7,3 @@ /**

* @typedef {string} TagName
* @typedef {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} Test
*/

@@ -60,3 +61,3 @@

* (<T extends Element>(node: unknown, test: T['tagName']|TestFunctionPredicate<T>|Array.<T['tagName']|TestFunctionPredicate<T>>, index?: number, parent?: Parent, context?: unknown) => node is T) &
* ((node?: unknown, test?: null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>, index?: number, parent?: Parent, context?: unknown) => boolean)
* ((node?: unknown, test?: Test, index?: number, parent?: Parent, context?: unknown) => boolean)
* )}

@@ -70,4 +71,3 @@ */

* @param {unknown} [node] Node to check
* @param {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} [test]
* When nullish, checks if `node` is a `Node`.
* @param {Test} [test] When nullish, checks if `node` is a `Node`.
* When `string`, works like passing `function (node) {return node.type === test}`.

@@ -123,3 +123,3 @@ * When `function` checks if function passed the node is true.

* (<T extends Element>(test: T['tagName']|TestFunctionPredicate<T>) => AssertPredicate<T>) &
* ((test?: null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>) => AssertAnything)
* ((test?: Test) => AssertAnything)
* )}

@@ -130,3 +130,3 @@ */

* Generate an assertion from a check.
* @param {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} [test]
* @param {Test} [test]
* When nullish, checks if `node` is a `Node`.

@@ -133,0 +133,0 @@ * When `string`, works like passing `function (node) {return node.type === test}`.

{
"name": "hast-util-is-element",
"version": "2.0.1",
"version": "2.1.0",
"description": "hast utility to check if a node is a (certain) element",

@@ -50,3 +50,3 @@ "license": "MIT",

"unified": "^9.0.0",
"xo": "^0.38.0"
"xo": "^0.39.0"
},

@@ -53,0 +53,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc