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.1.1 to 2.1.2

46

index.d.ts

@@ -10,2 +10,6 @@ /**

/**
* @template {Element} T
* @typedef {null|undefined|T['tagName']|TestFunctionPredicate<T>|Array.<T['tagName']|TestFunctionPredicate<T>>} PredicateTest
*/
/**
* Check if an element passes a test

@@ -24,3 +28,3 @@ *

* @callback TestFunctionPredicate
* @param {X} element
* @param {Element} element
* @param {number|null|undefined} [index]

@@ -49,20 +53,18 @@ * @param {Parent|null|undefined} [parent]

*/
export const isElement: (<T extends import('hast').Element>(
node: unknown,
test:
| T['tagName']
| TestFunctionPredicate<T>
| (T['tagName'] | TestFunctionPredicate<T>)[],
index?: number | undefined,
parent?:
| import('unist').Parent<
import('unist').Node<import('unist').Data>,
import('unist').Data
>
| undefined,
context?: unknown
) => node is T) &
export const isElement: (() => false) &
(<T extends import('hast').Element = import('hast').Element>(
node: unknown,
test?: PredicateTest<T>,
index?: number | undefined,
parent?:
| import('unist').Parent<
import('unist').Node<import('unist').Data>,
import('unist').Data
>
| undefined,
context?: unknown
) => node is T) &
((
node?: unknown,
test?: Test,
node: unknown,
test: Test,
index?: number | undefined,

@@ -91,2 +93,8 @@ parent?:

| Array<TagName | TestFunctionAnything>
export type PredicateTest<T extends import('hast').Element> =
| null
| undefined
| T['tagName']
| TestFunctionPredicate<T>
| Array<T['tagName'] | TestFunctionPredicate<T>>
/**

@@ -104,3 +112,3 @@ * Check if an element passes a test

export type TestFunctionPredicate<X extends import('hast').Element> = (
element: X,
element: Element,
index?: number | null | undefined,

@@ -107,0 +115,0 @@ parent?: Parent | null | undefined

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

/**
* @template {Element} T
* @typedef {null|undefined|T['tagName']|TestFunctionPredicate<T>|Array.<T['tagName']|TestFunctionPredicate<T>>} PredicateTest
*/
/**
* Check if an element passes a test

@@ -26,3 +31,3 @@ *

* @callback TestFunctionPredicate
* @param {X} element
* @param {Element} element
* @param {number|null|undefined} [index]

@@ -61,4 +66,5 @@ * @param {Parent|null|undefined} [parent]

* @type {(
* (<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?: Test, index?: number, parent?: Parent, context?: unknown) => boolean)
* (() => false) &
* (<T extends Element = Element>(node: unknown, test?: PredicateTest<T>, index?: number, parent?: Parent, context?: unknown) => node is T) &
* ((node: unknown, test: Test, index?: number, parent?: Parent, context?: unknown) => boolean)
* )}

@@ -65,0 +71,0 @@ */

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

@@ -42,11 +42,11 @@ "license": "MIT",

"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"tsd": "^0.17.0",
"tsd": "^0.19.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"unified": "^10.0.0",
"xo": "^0.42.0"
"xo": "^0.47.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