@altano/remark-mdx-toc-with-slugs
Advanced tools
Comparing version 0.0.1-alpha.1 to 1.0.0
@@ -32,11 +32,9 @@ // src/index.ts | ||
estreeVisit(estree, (esNode) => { | ||
if (esNode.type === "VariableDeclarator" && esNode.id.type === "Identifier" && esNode.id.name === name) { | ||
if (esNode.init) { | ||
const tocExportString = generate(esNode.init); | ||
const toc = JSON.parse(tocExportString); | ||
const tocWithSlugs = sluggifyTocEntries(toc); | ||
const newTree = valueToEstree(tocWithSlugs); | ||
if (newTree.type === "ArrayExpression") { | ||
esNode.init = newTree; | ||
} | ||
if (esNode.type === "VariableDeclarator" && esNode.id.type === "Identifier" && esNode.id.name === name && esNode.init) { | ||
const tocExportString = generate(esNode.init); | ||
const toc = JSON.parse(tocExportString); | ||
const tocWithSlugs = sluggifyTocEntries(toc); | ||
const newTree = valueToEstree(tocWithSlugs); | ||
if (newTree.type === "ArrayExpression") { | ||
esNode.init = newTree; | ||
} | ||
@@ -43,0 +41,0 @@ return EXIT; |
{ | ||
"name": "@altano/remark-mdx-toc-with-slugs", | ||
"version": "0.0.1-alpha.1", | ||
"version": "1.0.0", | ||
"description": "A remark plugin to generate a table of contents (including slugs) and convert it into MDX export", | ||
@@ -5,0 +5,0 @@ "type": "module", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
5363
62