npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

hast-util-interactive

1.0.4 • Public • Published

hast-util-interactive

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check whether a node is interactive.

Install

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/.github for ways to get started. See support.md for ways to get help.

This project 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

3

version

1.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability