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

@gustavnikolaj/string-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gustavnikolaj/string-utils - npm Package Compare versions

Comparing version 1.3.1 to 2.0.0

26

deindent.js

@@ -33,22 +33,18 @@ "use strict";

if (indentationOfFirstLine === 0) {
// Just remove leading and trailing spaces.
return str.trim();
var regexp = new RegExp("^[ ]{".concat(indentationOfFirstLine, "}"));
var strippedLines = indentationOfFirstLine === 0 ? lines : lines.map(function (line) {
return line.replace(regexp, "");
});
if (strippedLines[0].trim() === "") {
strippedLines = strippedLines.slice(1);
}
var regexp = new RegExp("^[ ]{".concat(indentationOfFirstLine, "}"));
return lines.reduce(function (strs, line, index) {
if (strs.length === 0 && line.trim() === "") {
return strs;
}
if (strippedLines.length > 0 && strippedLines[strippedLines.length - 1].trim() === "") {
strippedLines = strippedLines.slice(0, -1);
}
if (index + 1 === lines.length && line.trim() === "") {
return strs;
}
strs.push(line.replace(regexp, ""));
return strs;
}, []).join("\n");
return strippedLines.join("\n");
}
module.exports = exports.default;
{
"name": "@gustavnikolaj/string-utils",
"version": "1.3.1",
"version": "2.0.0",
"description": "Template string utilities",

@@ -19,3 +19,6 @@ "main": "index.js",

"lint": "eslint . && prettier --check '**/*.js'",
"postpublish": "git push origin --all && git push origin --tags",
"postversion": "npm publish",
"prepublish": "npm run build",
"preversion": "npm test",
"test": "mocha"

@@ -22,0 +25,0 @@ },

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