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

45
node_modules/mdast-util-to-hast/lib/one.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
'use strict'
module.exports = one
var u = require('unist-builder')
var all = require('./all')
var own = {}.hasOwnProperty
// Transform an unknown node.
function unknown(h, node) {
if (text(node)) {
return h.augment(node, u('text', node.value))
}
return h(node, 'div', all(h, node))
}
// Visit a node.
function one(h, node, parent) {
var type = node && node.type
var fn = own.call(h.handlers, type) ? h.handlers[type] : null
// Fail on non-nodes.
if (!type) {
throw new Error('Expected node, got `' + node + '`')
}
return (typeof fn === 'function' ? fn : unknown)(h, node, parent)
}
// Check if the node should be renderered a text node.
function text(node) {
var data = node.data || {}
if (
own.call(data, 'hName') ||
own.call(data, 'hProperties') ||
own.call(data, 'hChildren')
) {
return false
}
return 'value' in node
}