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

@curiositystream/legal-docs

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@curiositystream/legal-docs - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

4

package.json
{
"name": "@curiositystream/legal-docs",
"version": "1.0.3",
"version": "1.1.0",
"main": "script.js",

@@ -14,2 +14,4 @@ "files": [

"dependencies": {
"cheerio": "^1.0.0-rc.2",
"lodash": "^4.17.10",
"mammoth": "^1.4.6",

@@ -16,0 +18,0 @@ "mkdirp": "^0.5.1",

@@ -5,2 +5,4 @@ const fs = require("fs");

const mammoth = require("mammoth");
const cheerio = require("cheerio");
const _ = require("lodash");
const TurndownService = require("turndown");

@@ -37,4 +39,21 @@ const turndownService = new TurndownService();

fs.writeFileSync(outputPath.html, html);
const $ = cheerio.load(html);
// add anchor ids to section headers so we can link to each section
$("strong").each((i, elem) => {
const $el = $(elem);
const text = $el.text();
const headerRegex = /^[A-Z]\. /i;
const isHeader = headerRegex.test(text);
if (isHeader) {
const title = text.replace(headerRegex, "");
const id = _.kebabCase(title);
$el.attr("id", id);
}
});
fs.writeFileSync(outputPath.html, $.html());
return html;

@@ -41,0 +60,0 @@ });

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