Note This repository is automatically generated from the main parser monorepo. Please submit any issues or pull requests there.
Port of hast-util-is-element for xast
This package is ESM only. In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as
pnpm add xast-util-is-element
# or with yarn
# yarn add xast-util-is-element
# or with npm
# npm install xast-util-is-element
convertElement<T>(test: T["name"] | TestFunctionPredicate<T>): AssertPredicate<T>;
T
extendsElement
<T
>
Name | Type |
---|---|
test |
T ["name" ] |
Defined in: lib/xast-util-is-element.ts:174
convertElement(test?: Test): AssertAnything;
Name | Type |
---|---|
test? |
Test |
Defined in: lib/xast-util-is-element.ts:177
isElement(): false;
false
Defined in: lib/xast-util-is-element.ts:123
isElement<T>(
node: unknown,
test?: PredicateTest<T>,
index?: number,
parent?: Parent<Node<Data>, Data>,
context?: unknown): node is T;
T
extendsElement
<T
> =Element
Name | Type |
---|---|
node |
unknown |
test? |
PredicateTest <T > |
index? |
number |
parent? |
Parent <Node <Data >, Data > |
context? |
unknown |
node is T
Defined in: lib/xast-util-is-element.ts:124
isElement(
node: unknown,
test: Test,
index?: number,
parent?: Parent<Node<Data>, Data>,
context?: unknown): boolean;
Name | Type |
---|---|
node |
unknown |
test |
Test |
index? |
number |
parent? |
Parent <Node <Data >, Data > |
context? |
unknown |
boolean
Defined in: lib/xast-util-is-element.ts:131
Function
Check if a node is an element and passes a certain node test
(node?: unknown, index?: number | null, parent?: Parent | null): boolean;
Name | Type |
---|---|
node? |
unknown |
index? |
number |
parent? |
Parent |
boolean
Defined in: lib/xast-util-is-element.ts:40
<
Y
>Function
Y
extendsElement
Check if a node is an element and passes a certain node test
(node?: unknown, index?: number | null, parent?: Parent | null): node is Y;
Name | Type |
---|---|
node? |
unknown |
index? |
number |
parent? |
Parent |
node is Y
Defined in: lib/xast-util-is-element.ts:50
string
Defined in: lib/xast-util-is-element.ts:4
<
T
>null
|undefined
|T
["name"
] |TestFunctionPredicate
<T
> | (T
["name"
] |TestFunctionPredicate
<T
>)[]
T
extendsElement
Defined in: lib/xast-util-is-element.ts:12
null
|undefined
|Name
|TestFunctionAnything
| (Name
|TestFunctionAnything
)[]
Defined in: lib/xast-util-is-element.ts:5
Function
Check if an element passes a test
(element: Element, index?: number | null, parent?: Parent | null): boolean | void;
Name | Type |
---|---|
element |
Element |
index? |
number |
parent? |
Parent |
boolean
| void
Defined in: lib/xast-util-is-element.ts:22
<
X
>Function
X
extendsElement
Check if an element passes a certain node test
(element: Element, index?: number | null, parent?: Parent | null): element is X;
Name | Type |
---|---|
element |
Element |
index? |
number |
parent? |
Parent |
element is X
Defined in: lib/xast-util-is-element.ts:31
MIT © Thomas F. K. Jorna