JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 518880
  • Score
    100M100P100Q195280F
  • License MIT

Check if a node is a embedded element

Package Exports

  • hast-util-embedded

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hast-util-embedded) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hast-util-embedded Build Status Coverage Status

Check if a node is a embedded element.

Installation

npm:

npm install hast-util-embedded

hast-util-embedded is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.

Usage

Dependencies:

var embedded = require('hast-util-embedded');

Given a non-embedded value:

var result = embedded({
    'type': 'element',
    'tagName': 'a',
    'properties': {
        'href': '#alpha',
        'title': 'Bravo'
    },
    'children': [{
        'type': 'text',
        'value': 'Charlie'
    }]
});

Yields:

false

Given a embedded element:

result = embedded({
    'type': 'element',
    'tagName': 'audio',
    'properties': {
        'src': 'delta.ogg'
    },
    'children': []
});

Yields:

true

API

embedded(node)

Check if the given value is an embedded element.

Parameters: node (*) — Value to check.

Returns: boolean, whether node passes the test.

License

MIT © Titus Wormer