Check if a node is a script-supporting element.
npm:
npm install hast-util-script-supporting
hast-util-script-supporting is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.
Dependencies:
var scriptSupporting = require('hast-util-script-supporting');
Given a non-script-supporting value:
var result = scriptSupporting({
'type': 'element',
'tagName': 'a',
'properties': {
'href': '#alpha',
'title': 'Bravo'
},
'children': [{
'type': 'text',
'value': 'Charlie'
}]
});
Yields:
false
Given a script-supporting element:
result = scriptSupporting({
'type': 'element',
'tagName': 'template',
'children': [{
'type': 'text',
'value': 'Delta'
}]
});
Yields:
true
Check if the given value is a script-supporting element.
Parameters: node
(*
) — Value to check.
Returns: boolean
, whether node
passes the test.