render-hast.mjs
10 lines and 2 functions in DrDustinEdwards/prelum, at commit e389900 on 2026-10-24. This file on GitHub.
Functions
Imports
It imports no other module of this repo. Imported by render-diagram.mjs.
Source
// The two hast node builders the chart and diagram renderers write their figures with.
/** @param {string} tagName @param {Record<string, any>} properties @param {any[]} children */
export const h = (tagName, properties, children) => ({
type: "element",
tagName,
properties,
children,
});
/** @param {string} value */
export const text = (value) => ({ type: "text", value });