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

@bscotch/utility

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscotch/utility - npm Package Compare versions

Comparing version 0.11.1 to 0.12.0

4

build/lib/strings.d.ts

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

/**
* Remove ALL indents, from every line.
*/
export declare function nodent(strings: TemplateStringsArray, ...interps: any[]): string;
/**
* Remove linebreaks and extra spacing in a template string.

@@ -9,0 +13,0 @@ */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.oneline = exports.undent = void 0;
exports.oneline = exports.nodent = exports.undent = void 0;
function populateTemplate(strings, ...interps) {

@@ -36,2 +36,16 @@ let string = '';

/**
* Remove ALL indents, from every line.
*/
function nodent(strings, ...interps) {
let string = populateTemplate(strings, ...interps);
// Remove initial and final newlines
string = string
.replace(/^[\r\n]+/, '')
.replace(/\s+$/, '');
return string.split(/\r?\n/g)
.map(line => line.replace(/^\s*(.*?)/, "$1"))
.join("\n");
}
exports.nodent = nodent;
/**
* Remove linebreaks and extra spacing in a template string.

@@ -38,0 +52,0 @@ */

@@ -0,1 +1,10 @@

# [0.12.0](https://github.com/bscotch/node-util/compare/v0.11.1...v0.12.0) (2021-02-25)
### Features
* Add a 'nodent' tagged template to remove all indentation from a multiline string. ([4029137](https://github.com/bscotch/node-util/commit/4029137ca5ba237e3268dfe2d5789fc78470f427))
## [0.11.1](https://github.com/bscotch/node-util/compare/v0.11.0...v0.11.1) (2021-02-24)

@@ -2,0 +11,0 @@

2

package.json
{
"name": "@bscotch/utility",
"version": "0.11.1",
"version": "0.12.0",
"description": "Bscotch Utilities: Methods for common Node.js needs.",

@@ -5,0 +5,0 @@ "engines": {

@@ -38,3 +38,4 @@ # Bscotch Utilities

undent,
oneline
oneline,
nodent,
} from '@bscotch/utility';

@@ -62,2 +63,15 @@

// with the smallest indentation.`
nodent`
All lines will
be un-inindented
completely
but still on separate lines.
`;
// =>
//`All lines will
//be un-inindented
//completely
//but still on separate lines.`
```

@@ -64,0 +78,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