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

bit-docs-html-toc

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bit-docs-html-toc - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

9

make-tree.js

@@ -64,2 +64,11 @@ module.exports = function makeTree(elements) {

// Get elements without [data-skip] attribute only
elements = elements.filter(function(element) {
// check if element has attributes (for testing)
if (element.attributes) {
return !element.attributes['data-skip'];
}
return true;
});
return map.call(elements, function(element) {

@@ -66,0 +75,0 @@ var text = element.textContent;

4

package.json
{
"name": "bit-docs-html-toc",
"version": "1.1.1",
"version": "1.1.2",
"description": "table of contents bit-docs plugin",

@@ -41,4 +41,4 @@ "main": "toc.js",

"steal-mocha": "0.0.3",
"testee": "^0.3.0-pre.2"
"testee": "^0.9.1"
}
}

@@ -59,2 +59,14 @@ var makeTree = require("../make-tree");

});
it("allows ignoring elements with data-skip attribute", function() {
var elements = [
{ tagName: "h2", textContent: "new MyType", attributes: {} },
{ tagName: "h3", textContent: "Parameters", attributes: { 'data-skip': {} } },
{ tagName: "h2", textContent: "Configure", attributes: {} }
];
assert.deepEqual(makeTree(elements), [
{id: "new-mytype", level: 2, text: "new MyType", children: []},
{ id: "configure", level: 2, text: "Configure", children: [] }
]);
});
});
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