@tolki/str 1.0.10 → 1.0.11
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 +2 -0
- package/dist/index.js +62 -61
- package/dist/str.d.ts +6 -0
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +192 -186
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/abetwothree/laravel-ts-publish/refs/heads/main/assets/laravel-typescript-publish-logo-short.svg" width="50%" alt="Laravel Tolki JS Logo"></p>
|
|
2
|
+
|
|
1
3
|
# Tolki JS Str Package
|
|
2
4
|
|
|
3
5
|
This package provides string utility functions similar to Laravel's Str class facade.
|
package/dist/index.js
CHANGED
|
@@ -2,23 +2,23 @@ import { ascii as t, slug as a } from "./ascii/index.js";
|
|
|
2
2
|
import { bytesToBase64 as i, fromBase64 as o, toBase64 as n } from "./base64/index.js";
|
|
3
3
|
import { CaseTypes as c, convertCase as p, title as d, upper as u } from "./convertcase/index.js";
|
|
4
4
|
import { inlineMarkdown as f, markDownRenderer as h, markdown as g } from "./markdown/index.js";
|
|
5
|
-
import { inflector as U, isPlural as w, isSingular as x, matchCase as b, plural as
|
|
5
|
+
import { inflector as U, isPlural as w, isSingular as x, matchCase as b, plural as y, pluralPascal as C, pluralStudly as k, singular as R, uncountable as z } from "./pluralizer/index.js";
|
|
6
6
|
import { randomInt as W, randomString as q } from "./random/index.js";
|
|
7
7
|
import { substr as L, substrCount as v, substrReplace as E } from "./replacer/index.js";
|
|
8
|
-
import { after as
|
|
9
|
-
import { Stringable as
|
|
10
|
-
import { transliterate as
|
|
11
|
-
import { ltrim as
|
|
12
|
-
import { createUlidsNormally as
|
|
13
|
-
import { createUuidsNormally as kr, createUuidsUsing as
|
|
8
|
+
import { after as M, afterLast as N, apa as P, before as T, beforeLast as D, between as I, betweenFirst as J, camel as O, camelCacheSize as j, charAt as G, chopEnd as H, chopStart as K, contains as Q, containsAll as V, createRandomStringsNormally as X, createRandomStringsUsing as Y, createRandomStringsUsingSequence as Z, deduplicate as _, doesntContain as $, doesntEndWith as ee, doesntStartWith as re, endsWith as te, excerpt as ae, finish as se, flushCache as ie, headline as oe, initials as ne, is as le, isAscii as ce, isJson as pe, isMatch as de, isUrl as ue, kebab as me, lcfirst as fe, length as he, limit as ge, lower as Se, makePad as Ue, mask as we, match as xe, matchAll as be, numbers as ye, padBoth as Ce, padLeft as ke, padRight as Re, pascal as ze, password as Ae, position as We, random as qe, remove as Be, repeat as Le, replace as ve, replaceArray as Ee, replaceEnd as Fe, replaceFirst as Me, replaceLast as Ne, replaceMatches as Pe, replaceStart as Te, resetFactoryState as De, reverse as Ie, snake as Je, snakeCacheSize as Oe, squish as je, start as Ge, startsWith as He, stripTags as Ke, studly as Qe, studlyCacheSize as Ve, swap as Xe, take as Ye, toStringOr as Ze, ucfirst as _e, ucsplit as $e, ucwords as er, unwrap as rr, wordCount as tr, wordWrap as ar, words as sr, wrap as ir } from "./str.js";
|
|
9
|
+
import { Stringable as nr, of as lr, str as cr } from "./stringable/index.js";
|
|
10
|
+
import { transliterate as dr } from "./transliterate/index.js";
|
|
11
|
+
import { ltrim as mr, rtrim as fr, trim as hr } from "./trimmer/index.js";
|
|
12
|
+
import { createUlidsNormally as Sr, createUlidsUsing as Ur, createUlidsUsingSequence as wr, freezeUlids as xr, isUlid as br, ulid as yr } from "./ulid/index.js";
|
|
13
|
+
import { createUuidsNormally as kr, createUuidsUsing as Rr, createUuidsUsingSequence as zr, freezeUuids as Ar, isUuid as Wr, uuid as qr, uuid7 as Br } from "./uuid/index.js";
|
|
14
14
|
export {
|
|
15
15
|
c as CaseTypes,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
nr as Stringable,
|
|
17
|
+
M as after,
|
|
18
|
+
N as afterLast,
|
|
19
|
+
P as apa,
|
|
20
20
|
t as ascii,
|
|
21
|
-
|
|
21
|
+
T as before,
|
|
22
22
|
D as beforeLast,
|
|
23
23
|
I as between,
|
|
24
24
|
J as betweenFirst,
|
|
@@ -34,12 +34,12 @@ export {
|
|
|
34
34
|
X as createRandomStringsNormally,
|
|
35
35
|
Y as createRandomStringsUsing,
|
|
36
36
|
Z as createRandomStringsUsingSequence,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
Sr as createUlidsNormally,
|
|
38
|
+
Ur as createUlidsUsing,
|
|
39
|
+
wr as createUlidsUsingSequence,
|
|
40
40
|
kr as createUuidsNormally,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
Rr as createUuidsUsing,
|
|
42
|
+
zr as createUuidsUsingSequence,
|
|
43
43
|
_ as deduplicate,
|
|
44
44
|
$ as doesntContain,
|
|
45
45
|
ee as doesntEndWith,
|
|
@@ -48,8 +48,8 @@ export {
|
|
|
48
48
|
ae as excerpt,
|
|
49
49
|
se as finish,
|
|
50
50
|
ie as flushCache,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
xr as freezeUlids,
|
|
52
|
+
Ar as freezeUuids,
|
|
53
53
|
o as fromBase64,
|
|
54
54
|
oe as headline,
|
|
55
55
|
U as inflector,
|
|
@@ -61,15 +61,15 @@ export {
|
|
|
61
61
|
de as isMatch,
|
|
62
62
|
w as isPlural,
|
|
63
63
|
x as isSingular,
|
|
64
|
-
|
|
64
|
+
br as isUlid,
|
|
65
65
|
ue as isUrl,
|
|
66
|
-
|
|
66
|
+
Wr as isUuid,
|
|
67
67
|
me as kebab,
|
|
68
68
|
fe as lcfirst,
|
|
69
69
|
he as length,
|
|
70
70
|
ge as limit,
|
|
71
71
|
Se as lower,
|
|
72
|
-
|
|
72
|
+
mr as ltrim,
|
|
73
73
|
Ue as makePad,
|
|
74
74
|
h as markDownRenderer,
|
|
75
75
|
g as markdown,
|
|
@@ -77,16 +77,16 @@ export {
|
|
|
77
77
|
xe as match,
|
|
78
78
|
be as matchAll,
|
|
79
79
|
b as matchCase,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
ye as numbers,
|
|
81
|
+
lr as of,
|
|
82
|
+
Ce as padBoth,
|
|
83
|
+
ke as padLeft,
|
|
84
84
|
Re as padRight,
|
|
85
85
|
ze as pascal,
|
|
86
86
|
Ae as password,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
y as plural,
|
|
88
|
+
C as pluralPascal,
|
|
89
|
+
k as pluralStudly,
|
|
90
90
|
We as position,
|
|
91
91
|
qe as random,
|
|
92
92
|
W as randomInt,
|
|
@@ -95,45 +95,46 @@ export {
|
|
|
95
95
|
Le as repeat,
|
|
96
96
|
ve as replace,
|
|
97
97
|
Ee as replaceArray,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
De as
|
|
104
|
-
|
|
98
|
+
Fe as replaceEnd,
|
|
99
|
+
Me as replaceFirst,
|
|
100
|
+
Ne as replaceLast,
|
|
101
|
+
Pe as replaceMatches,
|
|
102
|
+
Te as replaceStart,
|
|
103
|
+
De as resetFactoryState,
|
|
104
|
+
Ie as reverse,
|
|
105
|
+
fr as rtrim,
|
|
105
106
|
R as singular,
|
|
106
107
|
a as slug,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
Je as snake,
|
|
109
|
+
Oe as snakeCacheSize,
|
|
110
|
+
je as squish,
|
|
111
|
+
Ge as start,
|
|
112
|
+
He as startsWith,
|
|
113
|
+
cr as str,
|
|
114
|
+
Ke as stripTags,
|
|
115
|
+
Qe as studly,
|
|
116
|
+
Ve as studlyCacheSize,
|
|
116
117
|
L as substr,
|
|
117
118
|
v as substrCount,
|
|
118
119
|
E as substrReplace,
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
Xe as swap,
|
|
121
|
+
Ye as take,
|
|
121
122
|
d as title,
|
|
122
123
|
n as toBase64,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
Ze as toStringOr,
|
|
125
|
+
dr as transliterate,
|
|
126
|
+
hr as trim,
|
|
127
|
+
_e as ucfirst,
|
|
128
|
+
$e as ucsplit,
|
|
129
|
+
er as ucwords,
|
|
130
|
+
yr as ulid,
|
|
130
131
|
z as uncountable,
|
|
131
|
-
|
|
132
|
+
rr as unwrap,
|
|
132
133
|
u as upper,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
qr as uuid,
|
|
135
|
+
Br as uuid7,
|
|
136
|
+
tr as wordCount,
|
|
137
|
+
ar as wordWrap,
|
|
138
|
+
sr as words,
|
|
139
|
+
ir as wrap
|
|
139
140
|
};
|
package/dist/str.d.ts
CHANGED
|
@@ -809,4 +809,10 @@ export declare function studlyCacheSize(): number;
|
|
|
809
809
|
* @returns void
|
|
810
810
|
*/
|
|
811
811
|
export declare function flushCache(): void;
|
|
812
|
+
/**
|
|
813
|
+
* Return all factory functions to their default state.
|
|
814
|
+
*
|
|
815
|
+
* @returns void
|
|
816
|
+
*/
|
|
817
|
+
export declare function resetFactoryState(): void;
|
|
812
818
|
//# sourceMappingURL=str.d.ts.map
|
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":"AA6BA;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAatE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,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,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACnB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAM,GAAG,MAAM,EAAkB,GAC9C,MAAM,CAcR;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACrB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAM,GAAG,IAAW,GACjC,MAAM,CAcR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,QAAQ,GAAE,MAAa,EACvB,YAAY,GAAE,OAAe,GAC9B,MAAM,CAqFR;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
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { isArray as
|
|
1
|
+
import { isArray as S, toLower as U, isString as _, isFunction as Z, isNumber as j } from "@tolki/utils";
|
|
2
2
|
import { title as I, upper as T } from "./convertcase/index.js";
|
|
3
3
|
import { randomInt as O, randomString as D } from "./random/index.js";
|
|
4
|
-
import { substr as
|
|
4
|
+
import { substr as x } from "./replacer/index.js";
|
|
5
5
|
import { ltrim as q, rtrim as G, trim as Q } from "./trimmer/index.js";
|
|
6
|
+
import { createUlidsNormally as V } from "./ulid/index.js";
|
|
7
|
+
import { createUuidsNormally as X } from "./uuid/index.js";
|
|
6
8
|
const R = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
7
9
|
let L = null;
|
|
8
10
|
function B(t, e) {
|
|
@@ -11,50 +13,50 @@ function B(t, e) {
|
|
|
11
13
|
const n = String(e), r = t.indexOf(n);
|
|
12
14
|
return r === -1 ? t : t.slice(r + n.length);
|
|
13
15
|
}
|
|
14
|
-
function
|
|
16
|
+
function wt(t, e) {
|
|
15
17
|
if (e === "")
|
|
16
18
|
return t;
|
|
17
19
|
const n = t.lastIndexOf(String(e));
|
|
18
20
|
return n === -1 ? t : t.slice(n + String(e).length);
|
|
19
21
|
}
|
|
20
|
-
function
|
|
22
|
+
function Y(t, e) {
|
|
21
23
|
if (e === "")
|
|
22
24
|
return t;
|
|
23
25
|
const n = t.indexOf(String(e));
|
|
24
26
|
return n === -1 ? t : t.slice(0, n);
|
|
25
27
|
}
|
|
26
|
-
function
|
|
28
|
+
function v(t, e) {
|
|
27
29
|
if (e === "")
|
|
28
30
|
return t;
|
|
29
31
|
const n = t.lastIndexOf(String(e));
|
|
30
|
-
return n === -1 ? t :
|
|
32
|
+
return n === -1 ? t : x(t, 0, n);
|
|
31
33
|
}
|
|
32
|
-
function
|
|
33
|
-
return e === "" || n === "" ? t :
|
|
34
|
+
function St(t, e, n) {
|
|
35
|
+
return e === "" || n === "" ? t : v(B(t, e), n);
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
return e === "" || n === "" ? t :
|
|
37
|
+
function xt(t, e, n) {
|
|
38
|
+
return e === "" || n === "" ? t : Y(B(t, e), n);
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function $t(t) {
|
|
39
41
|
if (C.has(t))
|
|
40
42
|
return C.get(t);
|
|
41
|
-
const e =
|
|
43
|
+
const e = ct(K(t));
|
|
42
44
|
return C.set(t, e), e;
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function kt(t, e) {
|
|
45
47
|
const n = t.length;
|
|
46
48
|
return (e < 0 ? e < -n : e > n - 1) ? !1 : (e < 0 && (e += n), t.charAt(e));
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
for (const n of
|
|
50
|
+
function At(t, e) {
|
|
51
|
+
for (const n of S(e) ? e : [e])
|
|
50
52
|
if (n !== "" && t.startsWith(n)) {
|
|
51
53
|
const r = [...t], s = [...n];
|
|
52
54
|
return r.slice(s.length).join("");
|
|
53
55
|
}
|
|
54
56
|
return t;
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
for (const n of
|
|
58
|
+
function bt(t, e) {
|
|
59
|
+
for (const n of S(e) ? e : [e])
|
|
58
60
|
if (n !== "" && t.endsWith(n)) {
|
|
59
61
|
const r = [...t], s = [...n];
|
|
60
62
|
return r.slice(0, -s.length).join("");
|
|
@@ -70,59 +72,59 @@ function H(t, e, n = !1) {
|
|
|
70
72
|
return !0;
|
|
71
73
|
return !1;
|
|
72
74
|
}
|
|
73
|
-
function
|
|
75
|
+
function Et(t, e = "", n = {}) {
|
|
74
76
|
const { radius: r = 100, omission: s = "..." } = n, o = String(t ?? ""), c = e ?? "", i = ($) => $.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(o);
|
|
75
77
|
if (!l)
|
|
76
78
|
return null;
|
|
77
|
-
const p = String(l[1]), a = String(l[2]), g = String(l[3]), u = q(p), m = Array.from(u).length, y =
|
|
79
|
+
const p = String(l[1]), a = String(l[2]), g = String(l[3]), u = q(p), m = Array.from(u).length, y = x(u, Math.max(m - r, 0), r);
|
|
78
80
|
let w = q(y);
|
|
79
81
|
w !== u && (w = s + w);
|
|
80
|
-
const h = G(g), d =
|
|
82
|
+
const h = G(g), d = x(h, 0, r);
|
|
81
83
|
let k = G(d);
|
|
82
84
|
return k !== h && (k = k + s), w + a + k;
|
|
83
85
|
}
|
|
84
|
-
function
|
|
86
|
+
function Lt(t, e, n = !1) {
|
|
85
87
|
for (const r of e)
|
|
86
88
|
if (!H(t, r, n))
|
|
87
89
|
return !1;
|
|
88
90
|
return !0;
|
|
89
91
|
}
|
|
90
|
-
function
|
|
92
|
+
function Rt(t, e, n = !1) {
|
|
91
93
|
return !H(t, e, n);
|
|
92
94
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
+
function Ct(t, e = " ") {
|
|
96
|
+
return S(e) ? (e.forEach((n) => {
|
|
95
97
|
t = t.replace(new RegExp(`${n}+`, "g"), n);
|
|
96
98
|
}), t) : t.replace(new RegExp(`${e}+`, "g"), e);
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function W(t, e) {
|
|
99
101
|
if (t === null)
|
|
100
102
|
return !1;
|
|
101
|
-
t = String(t),
|
|
103
|
+
t = String(t), S(e) ? e = Array.from(e) : e = [String(e)];
|
|
102
104
|
for (const n of e)
|
|
103
105
|
if (n !== "" && t.endsWith(n))
|
|
104
106
|
return !0;
|
|
105
107
|
return !1;
|
|
106
108
|
}
|
|
107
|
-
function
|
|
108
|
-
return !
|
|
109
|
+
function Ft(t, e) {
|
|
110
|
+
return !W(t, e);
|
|
109
111
|
}
|
|
110
|
-
function
|
|
112
|
+
function Nt(t, e) {
|
|
111
113
|
const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
112
114
|
return t.replace(new RegExp(`(?:${n})+$`, "u"), "") + e;
|
|
113
115
|
}
|
|
114
|
-
function
|
|
116
|
+
function zt(t, e, n = null) {
|
|
115
117
|
return e + t + (n ?? e);
|
|
116
118
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
119
|
+
function _t(t, e, n = null) {
|
|
120
|
+
return M(t, e) && (t = x(t, N(e))), W(t, n ??= e) && (t = x(t, 0, -N(n))), t;
|
|
119
121
|
}
|
|
120
|
-
function
|
|
122
|
+
function Ot(t, e, n = !1) {
|
|
121
123
|
e = String(e);
|
|
122
124
|
let r;
|
|
123
125
|
typeof t == "string" ? r = [t] : r = Array.from(t);
|
|
124
126
|
for (let s of r) {
|
|
125
|
-
if (s = String(s), s === e || n &&
|
|
127
|
+
if (s = String(s), s === e || n && U(s) === U(e))
|
|
126
128
|
return !0;
|
|
127
129
|
s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
|
|
128
130
|
const o = n ? "iu" : "u";
|
|
@@ -131,13 +133,13 @@ function Ct(t, e, n = !1) {
|
|
|
131
133
|
}
|
|
132
134
|
return !1;
|
|
133
135
|
}
|
|
134
|
-
function
|
|
136
|
+
function Ut(t) {
|
|
135
137
|
for (let e = 0; e < t.length; e++)
|
|
136
138
|
if (t.charCodeAt(e) > 127)
|
|
137
139
|
return !1;
|
|
138
140
|
return !0;
|
|
139
141
|
}
|
|
140
|
-
function
|
|
142
|
+
function Wt(t) {
|
|
141
143
|
if (!_(t))
|
|
142
144
|
return !1;
|
|
143
145
|
try {
|
|
@@ -147,7 +149,7 @@ function zt(t) {
|
|
|
147
149
|
}
|
|
148
150
|
return !0;
|
|
149
151
|
}
|
|
150
|
-
function
|
|
152
|
+
function Mt(t, e = []) {
|
|
151
153
|
if (!_(t))
|
|
152
154
|
return !1;
|
|
153
155
|
const r = (e.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" : e.join("|")).split("|").map((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
@@ -177,31 +179,31 @@ function Nt(t, e = []) {
|
|
|
177
179
|
].join("");
|
|
178
180
|
return new RegExp(s, "iu").test(t);
|
|
179
181
|
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
182
|
+
function Pt(t) {
|
|
183
|
+
return it(t, "-");
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function N(t) {
|
|
184
186
|
return t.length;
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function It(t, e = 100, n = "...", r = !1) {
|
|
187
189
|
if (t.length <= e)
|
|
188
190
|
return t;
|
|
189
191
|
if (!r)
|
|
190
192
|
return t.slice(0, e).replace(/\s+$/, "") + n;
|
|
191
|
-
t =
|
|
193
|
+
t = ot(t).replace(/[\n\r]+/g, " ").trim();
|
|
192
194
|
const s = t.slice(0, e).replace(/\s+$/, "");
|
|
193
195
|
return t.substring(e, e + 1) === " " ? s + n : s.replace(/(.*)\s.*/, "$1") + n;
|
|
194
196
|
}
|
|
195
197
|
function J(t) {
|
|
196
|
-
return
|
|
198
|
+
return U(t);
|
|
197
199
|
}
|
|
198
|
-
function
|
|
200
|
+
function qt(t, e = 100, n = "...") {
|
|
199
201
|
if (e <= 0)
|
|
200
202
|
return t;
|
|
201
203
|
const r = e, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
|
|
202
|
-
return !o ||
|
|
204
|
+
return !o || N(t) === N(o[0]) ? t : o[0].trimEnd() + n;
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function Gt(t, e, n, r = null) {
|
|
205
207
|
if (e === "")
|
|
206
208
|
return t;
|
|
207
209
|
const s = t.length;
|
|
@@ -216,7 +218,7 @@ function Mt(t, e, n, r = null) {
|
|
|
216
218
|
const i = t.slice(0, o), f = c.length, l = t.slice(o + f);
|
|
217
219
|
return i + e.slice(0, 1).repeat(f) + l;
|
|
218
220
|
}
|
|
219
|
-
function
|
|
221
|
+
function Tt(t, e) {
|
|
220
222
|
let n = "u", r = t;
|
|
221
223
|
if (t.length >= 2 && t[0] === "/") {
|
|
222
224
|
let s = -1;
|
|
@@ -245,7 +247,7 @@ function Ut(t, e) {
|
|
|
245
247
|
return "";
|
|
246
248
|
}
|
|
247
249
|
}
|
|
248
|
-
function
|
|
250
|
+
function Bt(t, e) {
|
|
249
251
|
e = String(e);
|
|
250
252
|
const n = typeof t == "string" ? [t] : Array.from(t);
|
|
251
253
|
for (const r of n) {
|
|
@@ -279,7 +281,7 @@ function Pt(t, e) {
|
|
|
279
281
|
}
|
|
280
282
|
return !1;
|
|
281
283
|
}
|
|
282
|
-
function
|
|
284
|
+
function Ht(t, e) {
|
|
283
285
|
let n = "u", r = t;
|
|
284
286
|
if (t.length >= 2 && t[0] === "/") {
|
|
285
287
|
let o = -1;
|
|
@@ -313,37 +315,37 @@ function It(t, e) {
|
|
|
313
315
|
}
|
|
314
316
|
return s;
|
|
315
317
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
318
|
+
function Jt(t) {
|
|
319
|
+
return S(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
|
|
318
320
|
}
|
|
319
|
-
function
|
|
321
|
+
function Kt(t, e, n = " ") {
|
|
320
322
|
const r = t.length;
|
|
321
323
|
if (e <= r || n === "")
|
|
322
324
|
return t;
|
|
323
325
|
const s = e - r, o = Math.floor(s / 2), c = s - o;
|
|
324
|
-
return
|
|
326
|
+
return z(n, o) + t + z(n, c);
|
|
325
327
|
}
|
|
326
|
-
function
|
|
328
|
+
function Zt(t, e, n = " ") {
|
|
327
329
|
const r = t.length;
|
|
328
330
|
if (e <= r || n === "")
|
|
329
331
|
return t;
|
|
330
332
|
const o = e - r;
|
|
331
|
-
return
|
|
333
|
+
return z(n, o) + t;
|
|
332
334
|
}
|
|
333
|
-
function
|
|
335
|
+
function jt(t, e, n = " ") {
|
|
334
336
|
const r = t.length;
|
|
335
337
|
if (e <= r || n === "")
|
|
336
338
|
return t;
|
|
337
339
|
const o = e - r;
|
|
338
|
-
return t +
|
|
340
|
+
return t + z(n, o);
|
|
339
341
|
}
|
|
340
|
-
function
|
|
342
|
+
function z(t, e) {
|
|
341
343
|
if (e <= 0 || t.length === 0)
|
|
342
344
|
return "";
|
|
343
345
|
const n = Math.ceil(e / t.length);
|
|
344
346
|
return t.repeat(n).slice(0, e);
|
|
345
347
|
}
|
|
346
|
-
function
|
|
348
|
+
function Dt(t = 32, e = !0, n = !0, r = !0, s = !1) {
|
|
347
349
|
const l = [
|
|
348
350
|
e ? [
|
|
349
351
|
"a",
|
|
@@ -429,7 +431,7 @@ function Ht(t = 32, e = !0, n = !0, r = !0, s = !1) {
|
|
|
429
431
|
";"
|
|
430
432
|
] : null,
|
|
431
433
|
s ? [" "] : null
|
|
432
|
-
].filter((u) =>
|
|
434
|
+
].filter((u) => S(u));
|
|
433
435
|
if (l.length === 0 || t <= 0)
|
|
434
436
|
return "";
|
|
435
437
|
const p = [];
|
|
@@ -448,7 +450,7 @@ function Ht(t = 32, e = !0, n = !0, r = !0, s = !1) {
|
|
|
448
450
|
}
|
|
449
451
|
return p.join("");
|
|
450
452
|
}
|
|
451
|
-
function
|
|
453
|
+
function Qt(t, e, n = 0) {
|
|
452
454
|
if (e === "")
|
|
453
455
|
return !1;
|
|
454
456
|
const r = Array.from(t), s = Array.from(e);
|
|
@@ -468,31 +470,31 @@ function Jt(t, e, n = 0) {
|
|
|
468
470
|
}
|
|
469
471
|
return !1;
|
|
470
472
|
}
|
|
471
|
-
function
|
|
473
|
+
function tt(t = 16) {
|
|
472
474
|
return (L ?? ((n) => D(n)))(t);
|
|
473
475
|
}
|
|
474
|
-
function
|
|
476
|
+
function et(t) {
|
|
475
477
|
L = t;
|
|
476
478
|
}
|
|
477
|
-
function
|
|
479
|
+
function Vt(t, e) {
|
|
478
480
|
let n = 0;
|
|
479
481
|
const r = e ?? function(s) {
|
|
480
482
|
const o = L;
|
|
481
483
|
L = null;
|
|
482
|
-
const c =
|
|
484
|
+
const c = tt(s);
|
|
483
485
|
return L = o, n++, c;
|
|
484
486
|
};
|
|
485
|
-
|
|
487
|
+
et((s) => n < t.length ? String(t[n++]) : r(s));
|
|
486
488
|
}
|
|
487
|
-
function
|
|
489
|
+
function nt() {
|
|
488
490
|
L = null;
|
|
489
491
|
}
|
|
490
|
-
function
|
|
492
|
+
function Xt(t, e) {
|
|
491
493
|
return e <= 0 ? "" : t.repeat(e);
|
|
492
494
|
}
|
|
493
|
-
function
|
|
495
|
+
function Yt(t, e, n) {
|
|
494
496
|
let r;
|
|
495
|
-
typeof e == "object" && !
|
|
497
|
+
typeof e == "object" && !S(e) ? r = Object.values(e) : r = S(e) ? [...e] : Array.from(e);
|
|
496
498
|
const s = n.split(t);
|
|
497
499
|
if (s.length === 1)
|
|
498
500
|
return n;
|
|
@@ -503,7 +505,7 @@ function Dt(t, e, n) {
|
|
|
503
505
|
}
|
|
504
506
|
return String(o);
|
|
505
507
|
}
|
|
506
|
-
function
|
|
508
|
+
function vt(t, e) {
|
|
507
509
|
try {
|
|
508
510
|
const n = String(t);
|
|
509
511
|
if (n.length)
|
|
@@ -513,7 +515,7 @@ function Qt(t, e) {
|
|
|
513
515
|
return e;
|
|
514
516
|
}
|
|
515
517
|
}
|
|
516
|
-
function
|
|
518
|
+
function te(t, e, n, r = !0) {
|
|
517
519
|
const s = (l) => typeof l == "string" ? [l] : Array.from(l), o = s(t), c = s(e), i = (l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = (l) => o.reduce((p, a, g) => {
|
|
518
520
|
if (a === "") return p;
|
|
519
521
|
const u = c[g] ?? "";
|
|
@@ -524,26 +526,26 @@ function Vt(t, e, n, r = !0) {
|
|
|
524
526
|
}, l);
|
|
525
527
|
return _(n) ? f(n) : Array.from(n).map(f);
|
|
526
528
|
}
|
|
527
|
-
function
|
|
529
|
+
function rt(t, e, n) {
|
|
528
530
|
if (t = String(t), t === "")
|
|
529
531
|
return n;
|
|
530
532
|
const r = n.indexOf(t);
|
|
531
533
|
return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
|
|
532
534
|
}
|
|
533
|
-
function
|
|
534
|
-
return t = String(t), t === "" ? n :
|
|
535
|
+
function ee(t, e, n) {
|
|
536
|
+
return t = String(t), t === "" ? n : M(n, t) ? rt(t, e, n) : n;
|
|
535
537
|
}
|
|
536
|
-
function
|
|
538
|
+
function st(t, e, n) {
|
|
537
539
|
if (t = String(t), t === "")
|
|
538
540
|
return n;
|
|
539
541
|
const r = n.lastIndexOf(t);
|
|
540
542
|
return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
|
|
541
543
|
}
|
|
542
|
-
function
|
|
543
|
-
return t = String(t), t === "" ? n :
|
|
544
|
+
function ne(t, e, n) {
|
|
545
|
+
return t = String(t), t === "" ? n : W(n, t) ? st(t, e, n) : n;
|
|
544
546
|
}
|
|
545
|
-
function
|
|
546
|
-
const s = (a) =>
|
|
547
|
+
function re(t, e, n, r = -1) {
|
|
548
|
+
const s = (a) => S(a) ? a : [a], o = s(t);
|
|
547
549
|
function c(a) {
|
|
548
550
|
try {
|
|
549
551
|
if (a instanceof RegExp) {
|
|
@@ -630,9 +632,9 @@ function vt(t, e, n, r = -1) {
|
|
|
630
632
|
}
|
|
631
633
|
return g;
|
|
632
634
|
};
|
|
633
|
-
return
|
|
635
|
+
return S(n) ? n.map(p) : p(n);
|
|
634
636
|
}
|
|
635
|
-
function
|
|
637
|
+
function ot(t) {
|
|
636
638
|
let e = "", n = !1;
|
|
637
639
|
for (let r = 0; r < t.length; r++) {
|
|
638
640
|
const s = t[r];
|
|
@@ -640,7 +642,7 @@ function nt(t) {
|
|
|
640
642
|
}
|
|
641
643
|
return e;
|
|
642
644
|
}
|
|
643
|
-
function
|
|
645
|
+
function se(t, e, n = !0) {
|
|
644
646
|
const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => {
|
|
645
647
|
let i = c;
|
|
646
648
|
for (const f of r)
|
|
@@ -655,25 +657,25 @@ function te(t, e, n = !0) {
|
|
|
655
657
|
};
|
|
656
658
|
return typeof e == "string" ? o(e) : Array.from(e, (c) => o(String(c)));
|
|
657
659
|
}
|
|
658
|
-
function
|
|
660
|
+
function oe(t) {
|
|
659
661
|
return Array.from(t).reverse().join("");
|
|
660
662
|
}
|
|
661
|
-
function
|
|
663
|
+
function ie(t, e) {
|
|
662
664
|
const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
663
665
|
return e + t.replace(new RegExp(`^(?:${n})+`, "u"), "");
|
|
664
666
|
}
|
|
665
|
-
function
|
|
667
|
+
function ce(t) {
|
|
666
668
|
const e = String(t).trim();
|
|
667
669
|
if (e === "")
|
|
668
670
|
return "";
|
|
669
671
|
let n = e.split(/\s+/u);
|
|
670
|
-
return n.length > 1 ? n = n.map((s) => I(s)) : n =
|
|
672
|
+
return n.length > 1 ? n = n.map((s) => I(s)) : n = lt(n.join("_")).map((s) => I(s)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function le(t, e = !1) {
|
|
673
675
|
const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
|
|
674
676
|
return e ? T(r) : r;
|
|
675
677
|
}
|
|
676
|
-
function
|
|
678
|
+
function fe(t) {
|
|
677
679
|
if (t.trim() === "")
|
|
678
680
|
return t;
|
|
679
681
|
const e = /* @__PURE__ */ new Set([
|
|
@@ -729,17 +731,17 @@ function oe(t) {
|
|
|
729
731
|
}
|
|
730
732
|
return r.join(" ");
|
|
731
733
|
}
|
|
732
|
-
function
|
|
734
|
+
function it(t, e = "_") {
|
|
733
735
|
const r = `${t}|${e}`;
|
|
734
736
|
if (R.has(r))
|
|
735
737
|
return R.get(r);
|
|
736
738
|
let s = t;
|
|
737
|
-
return /^[a-z]+$/.test(t) || (s =
|
|
739
|
+
return /^[a-z]+$/.test(t) || (s = ft(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${e}`), s = J(s)), R.set(r, s), s;
|
|
738
740
|
}
|
|
739
|
-
function
|
|
741
|
+
function ae(t) {
|
|
740
742
|
return Q(t).replace(/[\s\u3164\u1160]+/gu, " ");
|
|
741
743
|
}
|
|
742
|
-
function
|
|
744
|
+
function M(t, e) {
|
|
743
745
|
if (t == null || e == null)
|
|
744
746
|
return !1;
|
|
745
747
|
let n;
|
|
@@ -754,8 +756,8 @@ function U(t, e) {
|
|
|
754
756
|
}
|
|
755
757
|
return !1;
|
|
756
758
|
}
|
|
757
|
-
function
|
|
758
|
-
return !
|
|
759
|
+
function ue(t, e) {
|
|
760
|
+
return !M(t, e);
|
|
759
761
|
}
|
|
760
762
|
function K(t) {
|
|
761
763
|
const e = t;
|
|
@@ -768,10 +770,10 @@ function K(t) {
|
|
|
768
770
|
}, o = r.map(s).join("");
|
|
769
771
|
return F.set(e, o), o;
|
|
770
772
|
}
|
|
771
|
-
function
|
|
773
|
+
function pe(t) {
|
|
772
774
|
return K(t);
|
|
773
775
|
}
|
|
774
|
-
function
|
|
776
|
+
function ge(t, e) {
|
|
775
777
|
if (!t || Object.keys(t).length === 0)
|
|
776
778
|
return e;
|
|
777
779
|
const n = Object.keys(t).filter((o) => o !== "");
|
|
@@ -781,28 +783,28 @@ function fe(t, e) {
|
|
|
781
783
|
const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(n.map(r).join("|"), "gu");
|
|
782
784
|
return e.replace(s, (o) => t[o]);
|
|
783
785
|
}
|
|
784
|
-
function
|
|
785
|
-
return e < 0 ?
|
|
786
|
+
function me(t, e) {
|
|
787
|
+
return e < 0 ? x(t, e) : x(t, 0, e);
|
|
786
788
|
}
|
|
787
|
-
function
|
|
788
|
-
return J(
|
|
789
|
+
function ct(t) {
|
|
790
|
+
return J(x(t, 0, 1)) + x(t, 1);
|
|
789
791
|
}
|
|
790
|
-
function
|
|
791
|
-
return T(
|
|
792
|
+
function he(t) {
|
|
793
|
+
return T(x(t, 0, 1)) + x(t, 1);
|
|
792
794
|
}
|
|
793
|
-
function
|
|
795
|
+
function lt(t) {
|
|
794
796
|
return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
|
|
795
797
|
}
|
|
796
|
-
function
|
|
798
|
+
function ft(t, e = ` \r
|
|
797
799
|
\f\v`) {
|
|
798
|
-
const n =
|
|
800
|
+
const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = n.length ? r(n) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", c = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
|
|
799
801
|
return t.replace(c, (i, f, l) => f + l.toUpperCase());
|
|
800
802
|
}
|
|
801
|
-
function
|
|
803
|
+
function de(t, e = null) {
|
|
802
804
|
const n = e && e.length > 0 ? e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? new RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, s = t.match(r);
|
|
803
805
|
return s ? s.length : 0;
|
|
804
806
|
}
|
|
805
|
-
function
|
|
807
|
+
function ye(t, e = 75, n = `
|
|
806
808
|
`, r = !1) {
|
|
807
809
|
if (t.length === 0 || e < 1 || n === "")
|
|
808
810
|
return t;
|
|
@@ -851,95 +853,99 @@ function ge(t, e = 75, n = `
|
|
|
851
853
|
}
|
|
852
854
|
return o.join(n);
|
|
853
855
|
}
|
|
854
|
-
function
|
|
856
|
+
function we() {
|
|
855
857
|
return R.size;
|
|
856
858
|
}
|
|
857
|
-
function
|
|
859
|
+
function Se() {
|
|
858
860
|
return C.size;
|
|
859
861
|
}
|
|
860
|
-
function
|
|
862
|
+
function xe() {
|
|
861
863
|
return F.size;
|
|
862
864
|
}
|
|
863
|
-
function
|
|
865
|
+
function $e() {
|
|
864
866
|
R.clear(), C.clear(), F.clear();
|
|
865
867
|
}
|
|
868
|
+
function ke() {
|
|
869
|
+
nt(), V(), X();
|
|
870
|
+
}
|
|
866
871
|
export {
|
|
867
872
|
B as after,
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
873
|
+
wt as afterLast,
|
|
874
|
+
fe as apa,
|
|
875
|
+
Y as before,
|
|
876
|
+
v as beforeLast,
|
|
877
|
+
St as between,
|
|
878
|
+
xt as betweenFirst,
|
|
879
|
+
$t as camel,
|
|
880
|
+
Se as camelCacheSize,
|
|
881
|
+
kt as charAt,
|
|
882
|
+
bt as chopEnd,
|
|
883
|
+
At as chopStart,
|
|
879
884
|
H as contains,
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
885
|
+
Lt as containsAll,
|
|
886
|
+
nt as createRandomStringsNormally,
|
|
887
|
+
et as createRandomStringsUsing,
|
|
888
|
+
Vt as createRandomStringsUsingSequence,
|
|
889
|
+
Ct as deduplicate,
|
|
890
|
+
Rt as doesntContain,
|
|
891
|
+
Ft as doesntEndWith,
|
|
892
|
+
ue as doesntStartWith,
|
|
893
|
+
W as endsWith,
|
|
894
|
+
Et as excerpt,
|
|
895
|
+
Nt as finish,
|
|
896
|
+
$e as flushCache,
|
|
897
|
+
ce as headline,
|
|
898
|
+
le as initials,
|
|
899
|
+
Ot as is,
|
|
900
|
+
Ut as isAscii,
|
|
901
|
+
Wt as isJson,
|
|
902
|
+
Bt as isMatch,
|
|
903
|
+
Mt as isUrl,
|
|
904
|
+
Pt as kebab,
|
|
905
|
+
ct as lcfirst,
|
|
906
|
+
N as length,
|
|
907
|
+
It as limit,
|
|
903
908
|
J as lower,
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
909
|
+
z as makePad,
|
|
910
|
+
Gt as mask,
|
|
911
|
+
Tt as match,
|
|
912
|
+
Ht as matchAll,
|
|
913
|
+
Jt as numbers,
|
|
914
|
+
Kt as padBoth,
|
|
915
|
+
Zt as padLeft,
|
|
916
|
+
jt as padRight,
|
|
917
|
+
pe as pascal,
|
|
918
|
+
Dt as password,
|
|
919
|
+
Qt as position,
|
|
920
|
+
tt as random,
|
|
921
|
+
se as remove,
|
|
922
|
+
Xt as repeat,
|
|
923
|
+
te as replace,
|
|
924
|
+
Yt as replaceArray,
|
|
925
|
+
ne as replaceEnd,
|
|
926
|
+
rt as replaceFirst,
|
|
927
|
+
st as replaceLast,
|
|
928
|
+
re as replaceMatches,
|
|
929
|
+
ee as replaceStart,
|
|
930
|
+
ke as resetFactoryState,
|
|
931
|
+
oe as reverse,
|
|
932
|
+
it as snake,
|
|
933
|
+
we as snakeCacheSize,
|
|
934
|
+
ae as squish,
|
|
935
|
+
ie as start,
|
|
936
|
+
M as startsWith,
|
|
937
|
+
ot as stripTags,
|
|
932
938
|
K as studly,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
939
|
+
xe as studlyCacheSize,
|
|
940
|
+
ge as swap,
|
|
941
|
+
me as take,
|
|
942
|
+
vt as toStringOr,
|
|
943
|
+
he as ucfirst,
|
|
944
|
+
lt as ucsplit,
|
|
945
|
+
ft as ucwords,
|
|
946
|
+
_t as unwrap,
|
|
947
|
+
de as wordCount,
|
|
948
|
+
ye as wordWrap,
|
|
949
|
+
qt as words,
|
|
950
|
+
zt as wrap
|
|
945
951
|
};
|
package/package.json
CHANGED