npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

hast-util-interactive

1.0.2 • Public • Published

hast-util-interactive Build Coverage Downloads Chat

Check whether a HAST node is interactive.

Installation

npm:

npm install hast-util-interactive

Usage

var interactive = require('hast-util-interactive')
 
interactive({
  type: 'element',
  tagName: 'a',
  properties: {},
  children: []
}) // => false
 
interactive({
  type: 'element',
  tagName: 'a',
  properties: {href: '#alpha'},
  children: []
}) // => true
 
interactive({
  type: 'element',
  tagName: 'video',
  properties: {controls: true},
  children: []
}) // => true

API

interactive(node)

Parameters
  • node (Node, optional) — Node to check.
Returns

boolean — Whether node is an Element categorised as interactive.

Contribute

See contributing.md in syntax-tree/hast for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

install

npm i hast-util-interactive

Downloadsweekly downloads

5

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability