@tolki/str 1.7.1 → 1.8.0
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.
- package/README.md +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/replacer/index.d.ts +1 -0
- package/dist/replacer/index.d.ts.map +1 -1
- package/dist/replacer/index.js +1 -1
- package/dist/str.d.ts +9 -8
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +149 -154
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1182,6 +1182,16 @@ const result = remove(
|
|
|
1182
1182
|
// result is "Ptr Pipr pickd a pck of pickld ppprs."
|
|
1183
1183
|
```
|
|
1184
1184
|
|
|
1185
|
+
The subject can also be a list, an object or a `Map` of strings, and the result keeps its shape and keys. A collection gives back what its `all()` holds, and any other iterable gives a list:
|
|
1186
|
+
|
|
1187
|
+
```javascript
|
|
1188
|
+
import { remove } from "@tolki/str";
|
|
1189
|
+
|
|
1190
|
+
const result = remove("o", { first: "Foo", last: "Boo" });
|
|
1191
|
+
|
|
1192
|
+
// result is { first: "F", last: "B" }
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1185
1195
|
#### repeat
|
|
1186
1196
|
|
|
1187
1197
|
Repeat the given string.
|
|
@@ -1221,6 +1231,16 @@ const result = replace(
|
|
|
1221
1231
|
// result is "Laravel Framework for Web Artisans"
|
|
1222
1232
|
```
|
|
1223
1233
|
|
|
1234
|
+
The subject can also be a list, an object or a `Map` of strings, and the result keeps its shape and keys. A collection gives back what its `all()` holds, and any other iterable gives a list:
|
|
1235
|
+
|
|
1236
|
+
```javascript
|
|
1237
|
+
import { replace } from "@tolki/str";
|
|
1238
|
+
|
|
1239
|
+
const result = replace("o", "0", { first: "Foo", last: "Boo" });
|
|
1240
|
+
|
|
1241
|
+
// result is { first: "F00", last: "B00" }
|
|
1242
|
+
```
|
|
1243
|
+
|
|
1224
1244
|
#### replaceArray
|
|
1225
1245
|
|
|
1226
1246
|
Replace a given value in the string sequentially with an array.
|
|
@@ -1486,6 +1506,8 @@ const result = substrCount(
|
|
|
1486
1506
|
// result is 2
|
|
1487
1507
|
```
|
|
1488
1508
|
|
|
1509
|
+
Offsets and lengths count characters, so an emoji counts as one. An empty needle throws, as it does in PHP. <!-- docs/php-parity/Str/substrCount.json, "substrCount-laravel-multibyte", "substrCount-empty-needle" -->
|
|
1510
|
+
|
|
1489
1511
|
#### substrReplace
|
|
1490
1512
|
|
|
1491
1513
|
Replace text within a portion of a string.
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/replacer/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare function substr(string: string, start: number, length?: number |
|
|
|
17
17
|
* @param offset - The starting position for the search. If negative, it starts that many characters from the end of the string.
|
|
18
18
|
* @param length - The length of the segment to search within. If omitted or null, searches to the end of the string. If negative, omits that many characters from the end.
|
|
19
19
|
* @returns The number of occurrences of the substring within the specified segment.
|
|
20
|
+
* @throws Error for an empty needle, as PHP's substr_count() throws its ValueError
|
|
20
21
|
*
|
|
21
22
|
* @see https://tolki.abe.dev/strings/string-utilities-list.html#substrcount
|
|
22
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replacer/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CAWR;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replacer/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CAWR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAU,EAClB,MAAM,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CAkBR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CACzB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,MAAM,CAAC;AACV,wBAAgB,aAAa,CACzB,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAClC,MAAM,EAAE,CAAC;AACZ,wBAAgB,aAAa,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjE,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAClC,MAAM,CAAC,MAAM,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClC,wBAAgB,aAAa,CACzB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClD,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAClC,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/replacer/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function r(e, t, n = null) {
|
|
|
5
5
|
return a >= i || o <= a ? "" : r.slice(a, o).join("");
|
|
6
6
|
}
|
|
7
7
|
function i(e, t, n = 0, r = null) {
|
|
8
|
-
if (t === "")
|
|
8
|
+
if (t === "") throw Error("substr_count(): Argument #2 ($needle) must not be empty");
|
|
9
9
|
let i = Array.from(e), a = i.length, { start: o, end: l } = s(a, n, r);
|
|
10
10
|
return o >= a || l <= o ? 0 : c(i.slice(o, l).join(""), t);
|
|
11
11
|
}
|
package/dist/str.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StringSubject, StringSubjectResult } from '@tolki/types';
|
|
1
2
|
/**
|
|
2
3
|
* Return the remainder of a string after the first occurrence of a given value.
|
|
3
4
|
*
|
|
@@ -504,14 +505,15 @@ export declare function toStringOr(value: unknown, fallback: string): string;
|
|
|
504
505
|
*
|
|
505
506
|
* @param search - The value or values to search for
|
|
506
507
|
* @param replacement - The value or values to replace with
|
|
507
|
-
* @param subject - The string or
|
|
508
|
+
* @param subject - The string, or the strings in a list, object, Map, collection or iterable
|
|
508
509
|
* @param caseSensitive - Whether the search should be case-sensitive (default: true)
|
|
509
|
-
* @returns The resulting string or
|
|
510
|
+
* @returns The resulting string, or the strings in the subject's shape: a list for a list or iterable, an object for an
|
|
511
|
+
* object, a Map for a Map, and what all() holds for a collection
|
|
510
512
|
* @throws TypeError when the search term is a string but the replacement is a list, mirroring PHP's str_replace
|
|
511
513
|
*
|
|
512
514
|
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replace
|
|
513
515
|
*/
|
|
514
|
-
export declare function replace<
|
|
516
|
+
export declare function replace<TSubject extends StringSubject<TSubject>>(search: string | Iterable<string>, replacement: string | Iterable<string>, subject: TSubject, caseSensitive?: boolean): StringSubjectResult<TSubject>;
|
|
515
517
|
/**
|
|
516
518
|
* Replace the first occurrence of a given value in the string.
|
|
517
519
|
*
|
|
@@ -587,15 +589,14 @@ export declare function stripTags(value: string): string;
|
|
|
587
589
|
* mirroring Laravel's behavior.
|
|
588
590
|
*
|
|
589
591
|
* @param search - The string or strings to remove
|
|
590
|
-
* @param subject - The string or strings
|
|
592
|
+
* @param subject - The string, or the strings in a list, object, Map, collection or iterable
|
|
591
593
|
* @param caseSensitive - Whether the search should be case-sensitive (default: true)
|
|
592
|
-
* @returns The resulting string or
|
|
594
|
+
* @returns The resulting string, or the strings in the subject's shape: a list for a list or iterable, an object for an
|
|
595
|
+
* object, a Map for a Map, and what all() holds for a collection
|
|
593
596
|
*
|
|
594
597
|
* @see https://tolki.abe.dev/strings/string-utilities-list.html#remove
|
|
595
598
|
*/
|
|
596
|
-
export declare function remove(search: string | Iterable<string>, subject:
|
|
597
|
-
export declare function remove(search: string | Iterable<string>, subject: Iterable<string>, caseSensitive?: boolean): string[];
|
|
598
|
-
export declare function remove(search: string | Iterable<string>, subject: string | Iterable<string>, caseSensitive?: boolean): string | string[];
|
|
599
|
+
export declare function remove<TSubject extends StringSubject<TSubject>>(search: string | Iterable<string>, subject: TSubject, caseSensitive?: boolean): StringSubjectResult<TSubject>;
|
|
599
600
|
/**
|
|
600
601
|
* Reverse the given string.
|
|
601
602
|
*
|
package/dist/str.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../src/str.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../src/str.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA4CvE;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAatE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAY1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAQvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAA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,GAAG,IAAW,GACjC,MAAM,CAcR;AAwDD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,QAAQ,GAAE,MAAa,EACvB,YAAY,GAAE,OAAe,GAC9B,MAAM,CAuGR;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAIjC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC"}
|
package/dist/str.js
CHANGED
|
@@ -4,66 +4,66 @@ import { substr as i } from "./replacer/index.js";
|
|
|
4
4
|
import { ltrim as a, rtrim as o, trim as s } from "./trimmer/index.js";
|
|
5
5
|
import { createUlidsNormally as c } from "./ulid/index.js";
|
|
6
6
|
import { createUuidsNormally as l } from "./uuid/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { hasOwnToString as u, isArray as d, isFunction as f, isIterable as p, isMap as m, isNull as h, isNumber as g, isObject as _, isPlainObject as v, isString as y, isUndefined as ee, phpStringCast as b, toLower as x } from "@tolki/utils";
|
|
8
8
|
// src/str.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = null;
|
|
10
|
+
function E(e, t) {
|
|
11
11
|
if (t === "") return e;
|
|
12
12
|
let n = String(t), r = e.indexOf(n);
|
|
13
13
|
return r === -1 ? e : e.slice(r + n.length);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function te(e, t) {
|
|
16
16
|
if (t === "") return e;
|
|
17
17
|
let n = e.lastIndexOf(String(t));
|
|
18
18
|
return n === -1 ? e : e.slice(n + String(t).length);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function D(e, t) {
|
|
21
21
|
if (t === "") return e;
|
|
22
22
|
let n = e.indexOf(String(t));
|
|
23
23
|
return n === -1 ? e : e.slice(0, n);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function O(e, t) {
|
|
26
26
|
if (t === "") return e;
|
|
27
27
|
let n = e.lastIndexOf(String(t));
|
|
28
28
|
return n === -1 ? e : i(e, 0, n);
|
|
29
29
|
}
|
|
30
|
-
function te(e, t, n) {
|
|
31
|
-
return t === "" || n === "" ? e : w(S(e, t), n);
|
|
32
|
-
}
|
|
33
30
|
function ne(e, t, n) {
|
|
34
|
-
return t === "" || n === "" ? e :
|
|
31
|
+
return t === "" || n === "" ? e : O(E(e, t), n);
|
|
35
32
|
}
|
|
36
|
-
function re(e) {
|
|
37
|
-
|
|
33
|
+
function re(e, t, n) {
|
|
34
|
+
return t === "" || n === "" ? e : D(E(e, t), n);
|
|
35
|
+
}
|
|
36
|
+
function ie(e) {
|
|
37
|
+
if (C.has(e)) return C.get(e);
|
|
38
38
|
let t = Y(J(e));
|
|
39
|
-
return
|
|
39
|
+
return C.set(e, t), t;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ae(e, t) {
|
|
42
42
|
let n = e.length;
|
|
43
43
|
return !(t < 0 ? t < -n : t > n - 1) && (t < 0 && (t += n), e.charAt(t));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
for (let n of
|
|
45
|
+
function oe(e, t) {
|
|
46
|
+
for (let n of d(t) ? t : [t]) if (n !== "" && e.startsWith(n)) {
|
|
47
47
|
let t = [...e], r = [...n];
|
|
48
48
|
return t.slice(r.length).join("");
|
|
49
49
|
}
|
|
50
50
|
return e;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
for (let n of
|
|
52
|
+
function se(e, t) {
|
|
53
|
+
for (let n of d(t) ? t : [t]) if (n !== "" && e.endsWith(n)) {
|
|
54
54
|
let t = [...e], r = [...n];
|
|
55
55
|
return t.slice(0, -r.length).join("");
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function k(e, t, n = !1) {
|
|
60
60
|
n && (e = e.toLowerCase());
|
|
61
61
|
let r;
|
|
62
62
|
r = typeof t == "string" ? [t] : Array.from(t);
|
|
63
63
|
for (let t of r) if (n && (t = t.toLowerCase()), t !== "" && e.includes(t)) return !0;
|
|
64
64
|
return !1;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ce(e, t = "", n = {}) {
|
|
67
67
|
let { radius: r = 100, omission: s = "..." } = n, c = String(e ?? ""), l = RegExp(`^(.*?)(${((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))(t ?? "")})(.*)$`, "iu").exec(c);
|
|
68
68
|
if (!l) return null;
|
|
69
69
|
let u = String(l[1]), d = String(l[2]), f = String(l[3]), p = a(u), m = Array.from(p).length, h = i(p, Math.max(m - r, 0), r), g = a(h);
|
|
@@ -71,59 +71,59 @@ function se(e, t = "", n = {}) {
|
|
|
71
71
|
let _ = o(f), v = i(_, 0, r), y = o(v);
|
|
72
72
|
return y !== _ && (y += s), g + d + y;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function le(e, t, n = !1) {
|
|
75
75
|
let r = !1;
|
|
76
|
-
for (let i of t) if (r = !0, !
|
|
76
|
+
for (let i of t) if (r = !0, !k(e, i, n)) return !1;
|
|
77
77
|
return r;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return !
|
|
79
|
+
function ue(e, t, n = !1) {
|
|
80
|
+
return !k(e, t, n);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
82
|
+
function de(e, t = " ") {
|
|
83
|
+
return d(t) ? (t.forEach((t) => {
|
|
84
84
|
e = e.replace(RegExp(`${t}+`, "g"), t);
|
|
85
85
|
}), e) : e.replace(RegExp(`${t}+`, "g"), t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function A(e, t) {
|
|
88
88
|
if (e === null) return !1;
|
|
89
|
-
e = String(e), t =
|
|
89
|
+
e = String(e), t = d(t) ? Array.from(t) : [String(t)];
|
|
90
90
|
for (let n of t) if (n !== "" && e.endsWith(n)) return !0;
|
|
91
91
|
return !1;
|
|
92
92
|
}
|
|
93
|
-
function de(e, t) {
|
|
94
|
-
return !E(e, t);
|
|
95
|
-
}
|
|
96
93
|
function fe(e, t) {
|
|
97
|
-
|
|
94
|
+
return !A(e, t);
|
|
95
|
+
}
|
|
96
|
+
function pe(e, t) {
|
|
97
|
+
let n = b(e), r = b(t);
|
|
98
98
|
if (r === "") return n;
|
|
99
99
|
let i = n.length;
|
|
100
100
|
for (; n.endsWith(r, i);) i -= r.length;
|
|
101
101
|
return `${n.slice(0, i)}${r}`;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function me(e, t, n = null) {
|
|
104
104
|
return t + e + (n ?? t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return q(e, t) && (e = i(e,
|
|
106
|
+
function he(e, t, n = null) {
|
|
107
|
+
return q(e, t) && (e = i(e, M(t))), A(e, n ??= t) && (e = i(e, 0, -M(n))), e;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ge(e, t, n = !1) {
|
|
110
110
|
t = String(t);
|
|
111
111
|
let r;
|
|
112
112
|
r = typeof e == "string" ? [e] : Array.from(e);
|
|
113
113
|
for (let e of r) {
|
|
114
|
-
if (e = String(e), e === t || n &&
|
|
114
|
+
if (e = String(e), e === t || n && x(e) === x(t)) return !0;
|
|
115
115
|
e = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), e = e.replace(/\\\*/g, ".*");
|
|
116
116
|
let r = n ? "iu" : "u";
|
|
117
117
|
if (RegExp(`^${e}$`, r).test(t)) return !0;
|
|
118
118
|
}
|
|
119
119
|
return !1;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function j(e) {
|
|
122
122
|
for (let t = 0; t < e.length; t++) if (e.charCodeAt(t) > 127) return !1;
|
|
123
123
|
return !0;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
if (!
|
|
125
|
+
function _e(e) {
|
|
126
|
+
if (!y(e)) return !1;
|
|
127
127
|
try {
|
|
128
128
|
JSON.parse(e);
|
|
129
129
|
} catch {
|
|
@@ -131,8 +131,8 @@ function ge(e) {
|
|
|
131
131
|
}
|
|
132
132
|
return !0;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
if (!
|
|
134
|
+
function ve(e, t = []) {
|
|
135
|
+
if (!y(e)) return !1;
|
|
136
136
|
let n = (t.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : t.join("|")).split("|").map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
137
137
|
try {
|
|
138
138
|
let t = new URL(e), r = t.protocol.replace(":", ""), i = t.hostname, a = e.slice(e.indexOf("://") + 3).startsWith("/"), o = i.length > 0 && !/^\.+$/.test(i) && !a, s = r === "file" && a;
|
|
@@ -158,28 +158,28 @@ function _e(e, t = []) {
|
|
|
158
158
|
].join("");
|
|
159
159
|
return new RegExp(r, "iu").test(e);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function ye(e) {
|
|
162
162
|
return K(e, "-");
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function M(e) {
|
|
165
165
|
return e.length;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function be(e, t = 100, n = "...", r = !1) {
|
|
168
168
|
if (e.length <= t) return e;
|
|
169
169
|
if (!r) return e.slice(0, t).trimEnd() + n;
|
|
170
170
|
e = G(e).replace(/[\n\r]+/g, " ").trim();
|
|
171
171
|
let i = e.slice(0, t).trimEnd();
|
|
172
172
|
return e.substring(t, t + 1) === " " || !/\s/.test(i) ? i + n : i.replace(/(.*)\s.*/, "$1") + n;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function N(e) {
|
|
175
|
+
return x(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function xe(e, t = 100, n = "...") {
|
|
178
178
|
if (t <= 0) return e;
|
|
179
179
|
let r = RegExp(`^\\s*(?:\\S+\\s*){1,${t}}`, "u"), i = e.match(r);
|
|
180
|
-
return !i ||
|
|
180
|
+
return !i || M(e) === M(i[0]) ? e : i[0].trimEnd() + n;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Se(e, t, n, r = null) {
|
|
183
183
|
if (t === "") return e;
|
|
184
184
|
let i = e.length, a = n;
|
|
185
185
|
n < 0 && (a = n < -i ? 0 : i + n);
|
|
@@ -188,7 +188,7 @@ function j(e, t, n, r = null) {
|
|
|
188
188
|
let s = e.slice(0, a), c = o.length, l = e.slice(a + c);
|
|
189
189
|
return s + t.slice(0, 1).repeat(c) + l;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ce(e, t) {
|
|
192
192
|
let n = "u", r = e;
|
|
193
193
|
if (e.length >= 2 && e[0] === "/") {
|
|
194
194
|
let t = -1;
|
|
@@ -213,7 +213,7 @@ function M(e, t) {
|
|
|
213
213
|
return "";
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function we(e, t) {
|
|
217
217
|
t = String(t);
|
|
218
218
|
let n = typeof e == "string" ? [e] : Array.from(e);
|
|
219
219
|
for (let e of n) {
|
|
@@ -241,7 +241,7 @@ function N(e, t) {
|
|
|
241
241
|
}
|
|
242
242
|
return !1;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Te(e, t) {
|
|
245
245
|
let n = "u", r = e;
|
|
246
246
|
if (e.length >= 2 && e[0] === "/") {
|
|
247
247
|
let t = -1;
|
|
@@ -269,29 +269,29 @@ function P(e, t) {
|
|
|
269
269
|
}
|
|
270
270
|
return i;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function Ee(e) {
|
|
273
|
+
return d(e) ? e.map((e) => e.replace(/\D/g, "")) : e.replace(/\D/g, "");
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function De(e, t, n = " ") {
|
|
276
276
|
let r = e.length;
|
|
277
277
|
if (t <= r || n === "") return e;
|
|
278
278
|
let i = t - r, a = Math.floor(i / 2), o = i - a;
|
|
279
|
-
return
|
|
279
|
+
return P(n, a) + e + P(n, o);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Oe(e, t, n = " ") {
|
|
282
282
|
let r = e.length;
|
|
283
|
-
return t <= r || n === "" ? e :
|
|
283
|
+
return t <= r || n === "" ? e : P(n, t - r) + e;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function ke(e, t, n = " ") {
|
|
286
286
|
let r = e.length;
|
|
287
|
-
return t <= r || n === "" ? e : e +
|
|
287
|
+
return t <= r || n === "" ? e : e + P(n, t - r);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function P(e, t) {
|
|
290
290
|
if (t <= 0 || e.length === 0) return "";
|
|
291
291
|
let n = Math.ceil(t / e.length);
|
|
292
292
|
return e.repeat(n).slice(0, t);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Ae(e = 32, t = !0, r = !0, i = !0, a = !1) {
|
|
295
295
|
let o = [
|
|
296
296
|
t ? /* @__PURE__ */ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") : null,
|
|
297
297
|
r ? [
|
|
@@ -308,12 +308,12 @@ function we(e = 32, t = !0, r = !0, i = !0, a = !1) {
|
|
|
308
308
|
] : null,
|
|
309
309
|
i ? /* @__PURE__ */ "~!#$%^&*()-_.,<>?/\\{}[]|:;".split("") : null,
|
|
310
310
|
a ? [" "] : null
|
|
311
|
-
].filter((e) =>
|
|
311
|
+
].filter((e) => d(e));
|
|
312
312
|
if (o.length === 0) throw Error("At least one character pool must be enabled.");
|
|
313
|
-
let s = o.flat(), c =
|
|
314
|
-
return
|
|
313
|
+
let s = o.flat(), c = F(o).slice(0, Math.max(0, e)).map((e) => e[n(0, e.length - 1)]), l = Array.from({ length: Math.max(0, e - c.length) }, () => s[n(0, s.length - 1)]);
|
|
314
|
+
return F([...c, ...l]).join("");
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function F(e) {
|
|
317
317
|
let t = [...e];
|
|
318
318
|
for (let e = t.length - 1; e > 0; e--) {
|
|
319
319
|
let r = n(0, e);
|
|
@@ -321,7 +321,7 @@ function I(e) {
|
|
|
321
321
|
}
|
|
322
322
|
return t;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function je(e, t, n = 0) {
|
|
325
325
|
if (t === "") return !1;
|
|
326
326
|
let r = Array.from(e), i = Array.from(t), a = n >= 0 ? n : r.length + n;
|
|
327
327
|
if (a < 0 && (a = 0), a >= r.length) return !1;
|
|
@@ -336,30 +336,30 @@ function Te(e, t, n = 0) {
|
|
|
336
336
|
}
|
|
337
337
|
return !1;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
return (
|
|
339
|
+
function I(e = 16) {
|
|
340
|
+
return (T ?? ((e) => r(e)))(e);
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
342
|
+
function L(e) {
|
|
343
|
+
T = e;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function Me(e, t) {
|
|
346
346
|
let n = 0, r = t ?? function(e) {
|
|
347
|
-
let t =
|
|
348
|
-
|
|
349
|
-
let r =
|
|
350
|
-
return
|
|
347
|
+
let t = T;
|
|
348
|
+
T = null;
|
|
349
|
+
let r = I(e);
|
|
350
|
+
return T = t, n++, r;
|
|
351
351
|
};
|
|
352
|
-
|
|
352
|
+
L((t) => n < e.length ? String(e[n++]) : r(t));
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
354
|
+
function R() {
|
|
355
|
+
T = null;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Ne(e, t) {
|
|
358
358
|
return t <= 0 ? "" : e.repeat(t);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Pe(e, t, n) {
|
|
361
361
|
let r;
|
|
362
|
-
r = typeof t == "object" && !
|
|
362
|
+
r = typeof t == "object" && !d(t) ? Object.values(t) : d(t) ? [...t] : Array.from(t);
|
|
363
363
|
let i = n.split(e);
|
|
364
364
|
if (i.length === 1) return n;
|
|
365
365
|
let a = i[0];
|
|
@@ -369,7 +369,7 @@ function Oe(e, t, n) {
|
|
|
369
369
|
}
|
|
370
370
|
return String(a);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function z(e, t) {
|
|
373
373
|
try {
|
|
374
374
|
let t = String(e);
|
|
375
375
|
if (t.length) return t;
|
|
@@ -378,42 +378,44 @@ function ke(e, t) {
|
|
|
378
378
|
return t;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
let i =
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
381
|
+
function B(e, t, n, r = !0) {
|
|
382
|
+
if (y(e) && !y(t)) throw TypeError("The replacement must be a string when the search term is a string.");
|
|
383
|
+
let i = y(e) ? [e] : Array.from(e, (e) => H(e)), a = y(t) ? i.map(() => t) : Array.from(t, (e) => H(e));
|
|
384
|
+
return V(n, (e) => r ? i.reduce((e, t, n) => t === "" ? e : e.split(t).join(a[n] ?? ""), e) : Fe(i, a, e));
|
|
385
|
+
}
|
|
386
|
+
function Fe(e, t, n) {
|
|
387
|
+
let r = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
388
|
+
return e.reduce((e, n, i) => {
|
|
389
|
+
if (n === "") return e;
|
|
390
|
+
let a = t[i] ?? "", o = new RegExp(r(n), j(n) ? "gi" : "giu");
|
|
391
|
+
return e.replace(o, () => a);
|
|
392
|
+
}, n);
|
|
393
|
+
}
|
|
394
|
+
function V(e, t) {
|
|
395
|
+
let n = (e) => Object.fromEntries(Object.entries(e).map(([e, n]) => [e, t(H(n))]));
|
|
396
|
+
return y(e) ? t(e) : d(e) ? e.map((e) => t(H(e))) : m(e) ? new Map(Array.from(e, ([e, n]) => [e, t(H(n))])) : v(e) ? n(e) : _(e) && f(e.all) ? V(e.all(), t) : p(e) ? Array.from(e, (e) => t(H(e))) : u(e) ? t(String(e)) : _(e) ? n(e) : t(H(e));
|
|
397
|
+
}
|
|
398
|
+
function H(e) {
|
|
399
|
+
return h(e) || ee(e) ? "" : String(e);
|
|
400
|
+
}
|
|
401
|
+
function U(e, t, n) {
|
|
400
402
|
if (e = String(e), e === "") return n;
|
|
401
403
|
let r = n.indexOf(e);
|
|
402
404
|
return r === -1 ? n : n.slice(0, r) + t + n.slice(r + e.length);
|
|
403
405
|
}
|
|
404
|
-
function
|
|
405
|
-
return e = String(e), e === "" ? n : q(n, e) ?
|
|
406
|
+
function Ie(e, t, n) {
|
|
407
|
+
return e = String(e), e === "" ? n : q(n, e) ? U(e, t, n) : n;
|
|
406
408
|
}
|
|
407
409
|
function W(e, t, n) {
|
|
408
410
|
if (e = String(e), e === "") return n;
|
|
409
411
|
let r = n.lastIndexOf(e);
|
|
410
412
|
return r === -1 ? n : n.slice(0, r) + t + n.slice(r + e.length);
|
|
411
413
|
}
|
|
412
|
-
function
|
|
413
|
-
return e = String(e), e === "" ? n :
|
|
414
|
+
function Le(e, t, n) {
|
|
415
|
+
return e = String(e), e === "" ? n : A(n, e) ? W(e, t, n) : n;
|
|
414
416
|
}
|
|
415
|
-
function
|
|
416
|
-
let i = (e) =>
|
|
417
|
+
function Re(e, t, n, r = -1) {
|
|
418
|
+
let i = (e) => d(e) ? e : [e], a = i(e);
|
|
417
419
|
function o(e) {
|
|
418
420
|
try {
|
|
419
421
|
if (e instanceof RegExp) {
|
|
@@ -448,7 +450,7 @@ function Me(e, t, n, r = -1) {
|
|
|
448
450
|
if (!t) return null;
|
|
449
451
|
s.push(t);
|
|
450
452
|
}
|
|
451
|
-
let c =
|
|
453
|
+
let c = f(t), l = c ? [] : i(t), u = (e) => {
|
|
452
454
|
let n = e;
|
|
453
455
|
for (let e = 0; e < s.length; e++) {
|
|
454
456
|
let i = s[e];
|
|
@@ -481,7 +483,7 @@ function Me(e, t, n, r = -1) {
|
|
|
481
483
|
}
|
|
482
484
|
return n;
|
|
483
485
|
};
|
|
484
|
-
return
|
|
486
|
+
return d(n) ? n.map(u) : u(n);
|
|
485
487
|
}
|
|
486
488
|
function G(e) {
|
|
487
489
|
let t = "", n = !1;
|
|
@@ -491,37 +493,30 @@ function G(e) {
|
|
|
491
493
|
}
|
|
492
494
|
return t;
|
|
493
495
|
}
|
|
494
|
-
function
|
|
495
|
-
|
|
496
|
-
if (!n) return B(e, "", r);
|
|
497
|
-
let i = m(e) ? [e] : Array.from(e, (e) => V(e)), a = (e) => {
|
|
498
|
-
let t = e;
|
|
499
|
-
for (let e of i) e !== "" && (t = t.split(e).join(""));
|
|
500
|
-
return t;
|
|
501
|
-
};
|
|
502
|
-
return m(r) ? a(r) : r.map(a);
|
|
496
|
+
function ze(e, t, n = !0) {
|
|
497
|
+
return B(e, "", t, n);
|
|
503
498
|
}
|
|
504
|
-
function
|
|
499
|
+
function Be(e) {
|
|
505
500
|
return Array.from(e).reverse().join("");
|
|
506
501
|
}
|
|
507
|
-
function
|
|
508
|
-
let n =
|
|
502
|
+
function Ve(e, t) {
|
|
503
|
+
let n = b(e), r = b(t);
|
|
509
504
|
if (r === "") return n;
|
|
510
505
|
let i = 0;
|
|
511
506
|
for (; n.startsWith(r, i);) i += r.length;
|
|
512
507
|
return `${r}${n.slice(i)}`;
|
|
513
508
|
}
|
|
514
|
-
function
|
|
509
|
+
function He(t) {
|
|
515
510
|
let n = String(t).trim();
|
|
516
511
|
if (n === "") return "";
|
|
517
512
|
let r = n.split(/\s+/u);
|
|
518
513
|
return r = r.length > 1 ? r.map((t) => e(t)) : X(r.join("_")).map((t) => e(t)), r.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((e) => e.length > 0).join(" ");
|
|
519
514
|
}
|
|
520
|
-
function
|
|
515
|
+
function Ue(e, n = !1) {
|
|
521
516
|
let r = e.split(/\s+/u).filter((e) => e.length > 0).map((e) => [...e][0]).join("");
|
|
522
517
|
return n ? t(r) : r;
|
|
523
518
|
}
|
|
524
|
-
function
|
|
519
|
+
function We(e) {
|
|
525
520
|
if (e.trim() === "") return e;
|
|
526
521
|
let t = /* @__PURE__ */ new Set(/* @__PURE__ */ "and.as.but.for.if.nor.or.so.yet.a.an.the.at.by.for.in.of.off.on.per.to.up.via.et.ou.un.une.la.le.les.de.du.des.par.à".split(".")), n = /* @__PURE__ */ new Set([
|
|
527
522
|
".",
|
|
@@ -549,17 +544,17 @@ function Re(e) {
|
|
|
549
544
|
}
|
|
550
545
|
function K(e, t = "_") {
|
|
551
546
|
let n = `${e}|${t}`;
|
|
552
|
-
if (
|
|
547
|
+
if (S.has(n)) return S.get(n);
|
|
553
548
|
let r = e;
|
|
554
|
-
return /^[a-z]+$/.test(e) || (r = Z(e).replace(/\s+/gu, ""), r = r.replace(/(.)(?=[A-Z])/g, `$1${t}`), r =
|
|
549
|
+
return /^[a-z]+$/.test(e) || (r = Z(e).replace(/\s+/gu, ""), r = r.replace(/(.)(?=[A-Z])/g, `$1${t}`), r = N(r)), S.set(n, r), r;
|
|
555
550
|
}
|
|
556
|
-
function
|
|
551
|
+
function Ge(e) {
|
|
557
552
|
return s(e).replace(/[\s\u3164\u1160]+/gu, " ");
|
|
558
553
|
}
|
|
559
554
|
function q(e, t) {
|
|
560
555
|
if (e == null || t == null) return !1;
|
|
561
556
|
let n;
|
|
562
|
-
n =
|
|
557
|
+
n = y(t) || g(t) ? [t] : Symbol.iterator in Object(t) ? Array.from(t) : [t];
|
|
563
558
|
let r = String(e);
|
|
564
559
|
for (let e of n) {
|
|
565
560
|
if (e == null) continue;
|
|
@@ -568,25 +563,25 @@ function q(e, t) {
|
|
|
568
563
|
}
|
|
569
564
|
return !1;
|
|
570
565
|
}
|
|
571
|
-
function
|
|
566
|
+
function Ke(e, t) {
|
|
572
567
|
return !q(e, t);
|
|
573
568
|
}
|
|
574
569
|
function J(e, t = !1) {
|
|
575
570
|
let n = e;
|
|
576
571
|
t && (n = e.replace(/(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu, (e, t, n) => t + n.toLowerCase()));
|
|
577
572
|
let r = n;
|
|
578
|
-
if (
|
|
573
|
+
if (w.has(r)) return w.get(r);
|
|
579
574
|
let i = String(n).replace(/[-_]+/g, " "), a = (i.trim() === "" ? [] : i.split(/\s+/u)).map((e) => {
|
|
580
575
|
if (!e) return e;
|
|
581
576
|
let t = Array.from(e);
|
|
582
577
|
return t[0].toUpperCase() + t.slice(1).join("");
|
|
583
578
|
}).join("");
|
|
584
|
-
return
|
|
579
|
+
return w.set(r, a), a;
|
|
585
580
|
}
|
|
586
|
-
function
|
|
581
|
+
function qe(e, t = !1) {
|
|
587
582
|
return J(e, t);
|
|
588
583
|
}
|
|
589
|
-
function
|
|
584
|
+
function Je(e, t) {
|
|
590
585
|
if (!e || Object.keys(e).length === 0) return t;
|
|
591
586
|
let n = Object.keys(e).filter((e) => e !== "");
|
|
592
587
|
if (n.length === 0) return t;
|
|
@@ -594,23 +589,23 @@ function He(e, t) {
|
|
|
594
589
|
let r = new RegExp(n.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), "gu");
|
|
595
590
|
return t.replace(r, (t) => e[t]);
|
|
596
591
|
}
|
|
597
|
-
function
|
|
592
|
+
function Ye(e, t) {
|
|
598
593
|
return t < 0 ? i(e, t) : i(e, 0, t);
|
|
599
594
|
}
|
|
600
595
|
function Y(e) {
|
|
601
|
-
return
|
|
596
|
+
return N(i(e, 0, 1)) + i(e, 1);
|
|
602
597
|
}
|
|
603
|
-
function
|
|
598
|
+
function Xe(e) {
|
|
604
599
|
return t(i(e, 0, 1)) + i(e, 1);
|
|
605
600
|
}
|
|
606
601
|
function X(e) {
|
|
607
602
|
return e.split(/(?=\p{Lu})/u).filter(Boolean);
|
|
608
603
|
}
|
|
609
604
|
function Z(e, t = " \r\n\f\v") {
|
|
610
|
-
let n =
|
|
605
|
+
let n = d(t) ? t.join("") : t, r = n.length ? ((e) => e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"))(n) : "", i = r.length ? `(?:\\s|[${r}])` : "\\s", a = RegExp(`(^|${i})(\\p{Ll})`, "gu");
|
|
611
606
|
return e.replace(a, (e, t, n) => t + n.toUpperCase());
|
|
612
607
|
}
|
|
613
|
-
function
|
|
608
|
+
function Ze(e, t = null) {
|
|
614
609
|
let n = t && t.length > 0 ? t.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, i = e.match(r);
|
|
615
610
|
return i ? i.length : 0;
|
|
616
611
|
}
|
|
@@ -622,12 +617,12 @@ function $(e, t, n) {
|
|
|
622
617
|
for (; r < n && Q(e[r]);) r++;
|
|
623
618
|
return r;
|
|
624
619
|
}
|
|
625
|
-
function
|
|
620
|
+
function Qe(e, t, n) {
|
|
626
621
|
let r = n;
|
|
627
622
|
for (; r > t && Q(e[r - 1]);) r--;
|
|
628
623
|
return r;
|
|
629
624
|
}
|
|
630
|
-
function
|
|
625
|
+
function $e(e, t = 75, n = "\n", r = !1) {
|
|
631
626
|
if (e.length === 0 || t < 1 || n === "") return e;
|
|
632
627
|
let i = e.split(/\r\n|\n|\r/), a = [];
|
|
633
628
|
for (let e of i) {
|
|
@@ -642,7 +637,7 @@ function qe(e, t = 75, n = "\n", r = !1) {
|
|
|
642
637
|
a.push(n.slice(o, i).join(""));
|
|
643
638
|
break;
|
|
644
639
|
}
|
|
645
|
-
let e =
|
|
640
|
+
let e = Qe(n, o, o + t);
|
|
646
641
|
a.push(n.slice(o, e).join("")), o += t;
|
|
647
642
|
}
|
|
648
643
|
else {
|
|
@@ -674,19 +669,19 @@ function qe(e, t = 75, n = "\n", r = !1) {
|
|
|
674
669
|
}
|
|
675
670
|
return a.join(n);
|
|
676
671
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
672
|
+
function et() {
|
|
673
|
+
return S.size;
|
|
679
674
|
}
|
|
680
|
-
function
|
|
681
|
-
return
|
|
675
|
+
function tt() {
|
|
676
|
+
return C.size;
|
|
682
677
|
}
|
|
683
|
-
function
|
|
684
|
-
return
|
|
678
|
+
function nt() {
|
|
679
|
+
return w.size;
|
|
685
680
|
}
|
|
686
|
-
function
|
|
687
|
-
|
|
681
|
+
function rt() {
|
|
682
|
+
S.clear(), C.clear(), w.clear();
|
|
688
683
|
}
|
|
689
|
-
function
|
|
690
|
-
|
|
684
|
+
function it() {
|
|
685
|
+
R(), c(), l();
|
|
691
686
|
}
|
|
692
|
-
export {
|
|
687
|
+
export { E as after, te as afterLast, We as apa, D as before, O as beforeLast, ne as between, re as betweenFirst, ie as camel, tt as camelCacheSize, ae as charAt, se as chopEnd, oe as chopStart, k as contains, le as containsAll, R as createRandomStringsNormally, L as createRandomStringsUsing, Me as createRandomStringsUsingSequence, de as deduplicate, ue as doesntContain, fe as doesntEndWith, Ke as doesntStartWith, A as endsWith, ce as excerpt, pe as finish, rt as flushCache, He as headline, Ue as initials, ge as is, j as isAscii, _e as isJson, we as isMatch, ve as isUrl, ye as kebab, Y as lcfirst, M as length, be as limit, N as lower, P as makePad, Se as mask, Ce as match, Te as matchAll, Ee as numbers, De as padBoth, Oe as padLeft, ke as padRight, qe as pascal, Ae as password, je as position, I as random, ze as remove, Ne as repeat, B as replace, Pe as replaceArray, Le as replaceEnd, U as replaceFirst, W as replaceLast, Re as replaceMatches, Ie as replaceStart, it as resetFactoryState, Be as reverse, K as snake, et as snakeCacheSize, Ge as squish, Ve as start, q as startsWith, G as stripTags, J as studly, nt as studlyCacheSize, Je as swap, Ye as take, z as toStringOr, Xe as ucfirst, X as ucsplit, Z as ucwords, he as unwrap, Ze as wordCount, $e as wordWrap, xe as words, me as wrap };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/str",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Utilities for working with strings similar to Laravel's Str & Stringable classes.",
|
|
5
5
|
"author": "Abraham Arango <https://github.com/abetwothree>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
"transliteration": "^2.7.0",
|
|
37
37
|
"ulid": "^3.0.2",
|
|
38
38
|
"uuid": "^14.0.3",
|
|
39
|
+
"@tolki/num": "^2.2.5",
|
|
39
40
|
"@tolki/utils": "^1.6.3",
|
|
40
|
-
"@tolki/
|
|
41
|
+
"@tolki/types": "^1.12.0"
|
|
41
42
|
},
|
|
42
43
|
"files": [
|
|
43
44
|
"dist"
|