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

glob-docs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-docs - npm Package Compare versions

Comparing version 0.0.6-alpha to 0.0.7-alpha

2

package.json
{
"name": "glob-docs",
"version": "0.0.6-alpha",
"version": "0.0.7-alpha",
"description": "",

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

@@ -19,2 +19,3 @@ const utils = require('./utils');

showSourceFile: true,
autoIndent: true,
...utils.parseTagParams(value)

@@ -21,0 +22,0 @@ };

@@ -41,2 +41,36 @@ function createLink(childTag, label, options) {

if (docTag.options.params.autoIndent) {
let sourceLines = docTag.metatags.codeSource.split('\n');
let count = 0;
let stripIndentCount = null;
for(const lineIndex in sourceLines) {
const sourceLine = sourceLines[lineIndex];
// no point to iterate white lines
if (sourceLine.trim() === "") {
continue;
};
for (const charIndex in sourceLine) {
const character = sourceLine[charIndex];
if (character === " ") {
count++;
} else {
break;
}
}
if (stripIndentCount === null || count < stripIndentCount) {
stripIndentCount = count;
}
}
const newLines = [];
for(const lineIndex in sourceLines) {
const sourceLine = sourceLines[lineIndex];
newLines.push(sourceLine.slice(stripIndentCount, sourceLine.length));
}
docTag.metatags.codeSource = newLines.join('\n');
}
return fileLink + [

@@ -43,0 +77,0 @@ `\`\`\`${docTag.options.params.lang}`,

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