UNPKG

@podlite/schema

Version:

AST tools for Podlite markup language

11 lines 404 B
import makeAttrsPod from './helpers/config'; export const getNodeId = (node, ctx) => { const conf = makeAttrsPod(node, ctx); if (conf.exists('id')) { return conf.getFirstValue('id'); } return node.id; }; export const getSafeNodeId = (node, ctx) => getNodeId(node, ctx)?.toString().replace(/\s/g, '-'); export const makeAttrs = makeAttrsPod; //# sourceMappingURL=ast-helpers.js.map