@thi.ng/strings
Advanced tools
Comparing version 3.7.3 to 3.7.4
# Change Log | ||
- **Last updated**: 2023-12-11T10:07:09Z | ||
- **Last updated**: 2023-12-18T13:41:19Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,9 @@ | ||
### [3.7.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/strings@3.7.4) (2023-12-18) | ||
#### 🩹 Bug fixes | ||
- improve split() regexp handling ([65fe14b](https://github.com/thi-ng/umbrella/commit/65fe14b)) | ||
- ensure given regexp has global flag enabled | ||
## [3.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/strings@3.7.0) (2023-11-24) | ||
@@ -14,0 +21,0 @@ |
{ | ||
"name": "@thi.ng/strings", | ||
"version": "3.7.3", | ||
"version": "3.7.4", | ||
"description": "Various string formatting & utility functions", | ||
@@ -38,6 +38,6 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.9.12", | ||
"@thi.ng/errors": "^2.4.6", | ||
"@thi.ng/hex": "^2.3.24", | ||
"@thi.ng/memoize": "^3.1.46" | ||
"@thi.ng/api": "^8.9.13", | ||
"@thi.ng/errors": "^2.4.7", | ||
"@thi.ng/hex": "^2.3.25", | ||
"@thi.ng/memoize": "^3.1.47" | ||
}, | ||
@@ -80,3 +80,3 @@ "devDependencies": { | ||
"engines": { | ||
"node": ">=12.7" | ||
"node": ">=18" | ||
}, | ||
@@ -209,3 +209,3 @@ "files": [ | ||
}, | ||
"gitHead": "5e7bafedfc3d53bc131469a28de31dd8e5b4a3ff\n" | ||
"gitHead": "25a42a81fac8603a1e440a7aa8bc343276211ff4\n" | ||
} |
@@ -144,3 +144,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
Package sizes (brotli'd, pre-treeshake): ESM: 5.41 KB | ||
Package sizes (brotli'd, pre-treeshake): ESM: 5.43 KB | ||
@@ -147,0 +147,0 @@ ## Dependencies |
@@ -11,2 +11,5 @@ /** | ||
* | ||
* If given an regexp as `delim`, the function ensures the regexp has its global | ||
* flag enabled. | ||
* | ||
* @param src - | ||
@@ -13,0 +16,0 @@ * @param delim - |
@@ -5,3 +5,10 @@ function* split(src, delim = /\r?\n/g, includeDelim = false) { | ||
const include = ~~includeDelim; | ||
const re = typeof delim === "string" ? new RegExp(delim, "g") : delim; | ||
let re; | ||
if (typeof delim === "string") { | ||
re = new RegExp(delim, "g"); | ||
} else if (!delim.flags.includes("g")) { | ||
re = new RegExp(delim, delim.flags + "g"); | ||
} else { | ||
re = delim; | ||
} | ||
for (; i < n; ) { | ||
@@ -8,0 +15,0 @@ const m = re.exec(src); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95841
1980
Updated@thi.ng/api@^8.9.13
Updated@thi.ng/errors@^2.4.7
Updated@thi.ng/hex@^2.3.25
Updated@thi.ng/memoize@^3.1.47