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

tocbot

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tocbot - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

0

config.js

@@ -0,0 +0,0 @@ var paths = {

@@ -0,0 +0,0 @@ ---

2

package.json
{
"name": "tocbot",
"version": "2.1.1",
"version": "2.1.2",
"description": "Generate a table of contents based on the heading structure of a html document.",

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

@@ -181,2 +181,8 @@ <h1 class="display--none">

### v2.1.2
#### Fixed
- [patch] prevent errors from being thrown when elements are not present and add tests.
### v2.1.1

@@ -183,0 +189,0 @@

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ var path = require('path');

@@ -0,0 +0,0 @@ var fs = require('fs');

@@ -0,0 +0,0 @@ var path = require('path');

@@ -48,2 +48,7 @@ /**

// Return if no parent is found.
if (parent === null) {
return;
}
// Remove existing child if it exists.

@@ -50,0 +55,0 @@ if (parent.firstChild) {

@@ -0,0 +0,0 @@ /**

@@ -141,4 +141,8 @@ /**

// Get headings array
// Get headings array.
headingsArray = parseContent.selectHeadings(options.contentSelector, options.headingSelector);
// Return if no headings are found.
if (headingsArray === null) {
return;
}

@@ -145,0 +149,0 @@ // Build nested headings array.

@@ -95,2 +95,3 @@ /**

console.warn('Element not found: ' + contentSelector); // eslint-disable-line
return null;
}

@@ -97,0 +98,0 @@ }

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ module.exports = function() {

@@ -80,2 +80,18 @@ var fs = require('fs');

});
it('should not throw an error if a content element isn\'t found', function () {
GLOBAL.window.tocbot.destroy();
expect(GLOBAL.window.tocbot.init).to.not.throw(Error);
GLOBAL.window.tocbot.init({
tocSelector: '.missing'
});
});
it('should not throw an error if a toc element isn\'t found', function () {
GLOBAL.window.tocbot.destroy();
expect(GLOBAL.window.tocbot.init).to.not.throw(Error);
GLOBAL.window.tocbot.init({
contentSelector: '.not-here'
});
});
});

@@ -82,0 +98,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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