@augment-vir/common 28.0.1 → 28.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,7 +43,10 @@ function collapseWhiteSpace(input, { keepNewLines } = {}) {
|
|
|
43
43
|
? input.replace(/[\s\n]*\n+[\s\n]*/g, '\n')
|
|
44
44
|
: // sometimes \n isn't included in \s
|
|
45
45
|
input.replace(/\n/g, ' ');
|
|
46
|
-
return newLineReplacement
|
|
46
|
+
return newLineReplacement
|
|
47
|
+
.trim()
|
|
48
|
+
.replace(/[^\S\r\n]/g, ' ')
|
|
49
|
+
.replace(/\s{2,}/g, ' ');
|
|
47
50
|
}
|
|
48
51
|
exports.collapseWhiteSpace = collapseWhiteSpace;
|
|
49
52
|
/** Same as String.prototype.split but includes the delimiter to split by in the output array. */
|
|
@@ -37,7 +37,10 @@ export function collapseWhiteSpace(input, { keepNewLines } = {}) {
|
|
|
37
37
|
? input.replace(/[\s\n]*\n+[\s\n]*/g, '\n')
|
|
38
38
|
: // sometimes \n isn't included in \s
|
|
39
39
|
input.replace(/\n/g, ' ');
|
|
40
|
-
return newLineReplacement
|
|
40
|
+
return newLineReplacement
|
|
41
|
+
.trim()
|
|
42
|
+
.replace(/[^\S\r\n]/g, ' ')
|
|
43
|
+
.replace(/\s{2,}/g, ' ');
|
|
41
44
|
}
|
|
42
45
|
/** Same as String.prototype.split but includes the delimiter to split by in the output array. */
|
|
43
46
|
export function splitIncludeSplit(original, splitterInput, caseSensitive) {
|