xast-util-has-attribute
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Note This repository is automatically generated from the main parser monorepo. Please submit any issues or pull requests there.

xast-util-has-attribute

npm version npm downloads

Port of hast-util-has-property for xast

Contents

What is this?

When should I use this?

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as

pnpm add xast-util-has-attribute
# or with yarn
# yarn add xast-util-has-attribute
# or with npm
# npm install xast-util-has-attribute

Use

API


hasAttribute()

Check if node has a set name property.

Signature

hasAttribute(node: unknown, name: string): boolean;

Parameters

Name Type
node unknown
name string

Returns

boolean

Defined in: lib/xast-util-has-attribute.ts:10

Syntax tree

Types

Compatibility

Security

Contribute

License

MIT © Thomas F. K. Jorna

Readme

Keywords

Package Sidebar

Install

npm i xast-util-has-attribute

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

6.82 kB

Total Files

7

Last publish

Collaborators

  • tefkah