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

@augment-vir/common

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@augment-vir/common - npm Package Compare versions

Comparing version 23.1.1 to 23.2.0

12

dist/cjs/augments/common-string.js

@@ -41,8 +41,8 @@ "use strict";

/** Collapse all consecutive white space into just one space and trim surrounding whitespace. */
function collapseWhiteSpace(input) {
return (input
// sometimes \n isn't included in \s
.replace(/\n/g, ' ')
.trim()
.replace(/\s{2,}/g, ' '));
function collapseWhiteSpace(input, { keepNewLines } = {}) {
const newLineReplacement = keepNewLines
? input.replace(/[\s\n]*\n+[\s\n]*/g, '\n')
: // sometimes \n isn't included in \s
input.replace(/\n/g, ' ');
return newLineReplacement.trim().replace(/\s{2,}/g, ' ');
}

@@ -49,0 +49,0 @@ exports.collapseWhiteSpace = collapseWhiteSpace;

@@ -35,8 +35,8 @@ import { ansiRegex } from './ansi';

/** Collapse all consecutive white space into just one space and trim surrounding whitespace. */
export function collapseWhiteSpace(input) {
return (input
// sometimes \n isn't included in \s
.replace(/\n/g, ' ')
.trim()
.replace(/\s{2,}/g, ' '));
export function collapseWhiteSpace(input, { keepNewLines } = {}) {
const newLineReplacement = keepNewLines
? input.replace(/[\s\n]*\n+[\s\n]*/g, '\n')
: // sometimes \n isn't included in \s
input.replace(/\n/g, ' ');
return newLineReplacement.trim().replace(/\s{2,}/g, ' ');
}

@@ -43,0 +43,0 @@ /** Same as String.prototype.split but includes the delimiter to split by in the output array. */

@@ -17,3 +17,5 @@ import { PartialAndUndefined } from './object/object';

/** Collapse all consecutive white space into just one space and trim surrounding whitespace. */
export declare function collapseWhiteSpace(input: string): string;
export declare function collapseWhiteSpace(input: string, { keepNewLines }?: PartialAndUndefined<{
keepNewLines: boolean;
}>): string;
/** Same as String.prototype.split but includes the delimiter to split by in the output array. */

@@ -20,0 +22,0 @@ export declare function splitIncludeSplit(original: string, splitterInput: string | RegExp, caseSensitive: boolean): readonly string[];

{
"name": "@augment-vir/common",
"version": "23.1.1",
"version": "23.2.0",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",

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

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