New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@altano/remark-mdx-toc-with-slugs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altano/remark-mdx-toc-with-slugs - npm Package Compare versions

Comparing version 0.0.1-alpha.1 to 1.0.0

16

dist/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc