Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
visit(ast, 'element', node => {
if (is(node, headings) && has(node, 'id')) {
vFile.data.slugs.push({
depth: parseInt(node.tagName[1], 10) - 1,
value: toString(node),
heading: (node.properties as any)?.id,
});
}
});
} else {