Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdast-util-toc

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-toc - npm Package Compare versions

Comparing version 0.1.0 to 1.0.1

13

lib/index.js

@@ -13,2 +13,4 @@ /**

/* Dependencies */
var remark = require('remark');
var slug = require('remark-slug');
var toExpression = require('./to-expression');

@@ -31,9 +33,14 @@ var search = require('./search');

var result = search(node, heading, depth);
var processor = remark().use(slug);
var tree = processor.run(node);
var result = search(tree, heading, depth);
if (result.index === null || !result.map.length) {
return [];
return result;
}
return [contents(result.map, tight)];
return {
map: [contents(result.map, tight)],
index: result.index
};
}
{
"name": "mdast-util-toc",
"version": "0.1.0",
"version": "1.0.1",
"description": "Generate a Table of Contents (TOC) from a given Markdown file",

@@ -5,0 +5,0 @@ "main": "index.js",

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