planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

82
node_modules/hast-util-is-element/convert.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
'use strict'
module.exports = convert
function convert(test) {
if (typeof test === 'string') {
return tagNameFactory(test)
}
if (test === null || test === undefined) {
return element
}
if (typeof test === 'object') {
return any(test)
}
if (typeof test === 'function') {
return callFactory(test)
}
throw new Error('Expected function, string, or array as test')
}
function convertAll(tests) {
var length = tests.length
var index = -1
var results = []
while (++index < length) {
results[index] = convert(tests[index])
}
return results
}
function any(tests) {
var checks = convertAll(tests)
var length = checks.length
return matches
function matches() {
var index = -1
while (++index < length) {
if (checks[index].apply(this, arguments)) {
return true
}
}
return false
}
}
// Utility to convert a string a tag name check.
function tagNameFactory(test) {
return tagName
function tagName(node) {
return element(node) && node.tagName === test
}
}
// Utility to convert a function check.
function callFactory(test) {
return call
function call(node) {
return element(node) && Boolean(test.apply(this, arguments))
}
}
// Utility to return true if this is an element.
function element(node) {
return (
node &&
typeof node === 'object' &&
node.type === 'element' &&
typeof node.tagName === 'string'
)
}