astro.ts
782 Bytes
import Children from './children.astro'
import Custom from './custom.astro'
import Match from './match.astro'
import Node from './node.astro'
import Replace from './replace.astro'
import External from './external.astro'
import WrapNode from './wrap-node.astro'
import ReplaceNode from './replace-node.astro'
export { Children, Custom, Match, Node, Replace, External, WrapNode, ReplaceNode }
import type { NodeType } from 'ultrahtml'
type SlotHandler = (string, NodeType) => Promise<Any>
type Replacements = Record<string, string>
export const createForceSetAttributes = (overrideAttributes) => (node) => {
if (!overrideAttributes) return node
const { attributes } = node
if (!attributes) return node
return {...node, attributes: {...attributes, ...overrideAttributes}}
}