@thi.ng/strings
Advanced tools
Comparing version 3.7.32 to 3.7.33
@@ -8,4 +8,3 @@ import { memoizeJ } from "@thi.ng/memoize/memoizej"; | ||
return (x) => { | ||
if (x == null) | ||
return buf; | ||
if (x == null) return buf; | ||
x = x.toString(); | ||
@@ -12,0 +11,0 @@ const r = (n - x.length) / 2; |
# Change Log | ||
- **Last updated**: 2024-04-23T07:02:18Z | ||
- **Last updated**: 2024-05-08T18:24:31Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
const computeCursorPos = (str, pos, delim = "\n", offset = [1, 1]) => { | ||
if (!str.length) | ||
return [1, 1]; | ||
if (!str.length) return [1, 1]; | ||
pos = Math.min(Math.max(0, pos), str.length); | ||
@@ -9,4 +8,3 @@ const lines = str.split(delim); | ||
const l = lines[i]; | ||
if (pos <= l.length) | ||
return [i + offset[0], pos + offset[1]]; | ||
if (pos <= l.length) return [i + offset[0], pos + offset[1]]; | ||
pos -= l.length + 1; | ||
@@ -13,0 +11,0 @@ } |
{ | ||
"name": "@thi.ng/strings", | ||
"version": "3.7.32", | ||
"version": "3.7.33", | ||
"description": "Various string formatting & utility functions", | ||
@@ -39,12 +39,12 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/errors": "^2.5.6", | ||
"@thi.ng/hex": "^2.3.45", | ||
"@thi.ng/memoize": "^3.3.3" | ||
"@thi.ng/api": "^8.11.2", | ||
"@thi.ng/errors": "^2.5.7", | ||
"@thi.ng/hex": "^2.3.46", | ||
"@thi.ng/memoize": "^3.3.4" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.43.0", | ||
"esbuild": "^0.20.2", | ||
"typedoc": "^0.25.12", | ||
"typescript": "^5.4.3" | ||
"@microsoft/api-extractor": "^7.43.2", | ||
"esbuild": "^0.21.1", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -207,3 +207,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n" | ||
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n" | ||
} |
@@ -6,4 +6,3 @@ import { memoizeJ } from "@thi.ng/memoize/memoizej"; | ||
return (x, len) => { | ||
if (x == null) | ||
return buf; | ||
if (x == null) return buf; | ||
x = x.toString(); | ||
@@ -10,0 +9,0 @@ len = len !== void 0 ? len : x.length; |
@@ -6,4 +6,3 @@ import { memoizeJ } from "@thi.ng/memoize/memoizej"; | ||
return (x, len) => { | ||
if (x == null) | ||
return buf; | ||
if (x == null) return buf; | ||
x = x.toString(); | ||
@@ -10,0 +9,0 @@ len = len !== void 0 ? len : x.length; |
@@ -154,3 +154,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
Package sizes (brotli'd, pre-treeshake): ESM: 5.42 KB | ||
Package sizes (brotli'd, pre-treeshake): ESM: 5.43 KB | ||
@@ -157,0 +157,0 @@ ## Dependencies |
@@ -30,4 +30,3 @@ import { defError } from "@thi.ng/errors/deferror"; | ||
c = (c & 7) << 18 | (buf[i++] & 63) << 12 | (buf[i++] & 63) << 6 | buf[i++] & 63; | ||
} else | ||
utf8Error(); | ||
} else utf8Error(); | ||
result += fromUtf8CodePoint(c); | ||
@@ -55,4 +54,3 @@ } | ||
buf[pos++] = 128 | c >> 12 & 63; | ||
} else | ||
buf[pos++] = 224 | c >> 12; | ||
} else buf[pos++] = 224 | c >> 12; | ||
buf[pos++] = 128 | c >> 6 & 63; | ||
@@ -66,4 +64,3 @@ } | ||
const fromUtf8CodePoint = (x) => { | ||
if (x < 65536) | ||
return String.fromCharCode(x); | ||
if (x < 65536) return String.fromCharCode(x); | ||
if (x < 1114112) { | ||
@@ -70,0 +67,0 @@ x -= 65536; |
@@ -29,4 +29,3 @@ import { lengthAnsi } from "./ansi.js"; | ||
while (match = re.exec(x)) { | ||
if (match.index >= max) | ||
break; | ||
if (match.index >= max) break; | ||
const n = match[0].length; | ||
@@ -33,0 +32,0 @@ i += n; |
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
98500
2030
Updated@thi.ng/api@^8.11.2
Updated@thi.ng/errors@^2.5.7
Updated@thi.ng/hex@^2.3.46
Updated@thi.ng/memoize@^3.3.4