@zinaid/str 0.0.7 → 0.0.9
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/dist/ascii/index.d.ts +11 -0
- package/dist/ascii/index.d.ts.map +1 -1
- package/dist/ascii/index.js +43 -4
- package/dist/index.js +91 -91
- package/dist/str.d.ts +0 -9
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +385 -423
- package/package.json +2 -28
package/dist/str.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { substr as x, ltrim as
|
|
2
|
-
import { isArray as S, toLower as
|
|
1
|
+
import { substr as x, ltrim as q, rtrim as G, randomInt as M, randomString as K, title as P, trim as Z, upper as D } from "@zinaid/str";
|
|
2
|
+
import { isArray as S, toLower as O, isString as N, isFunction as Q } from "@zinaid/utils";
|
|
3
3
|
const R = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
4
4
|
let b = null;
|
|
5
|
-
function
|
|
5
|
+
function T(t, e) {
|
|
6
6
|
if (e === "")
|
|
7
7
|
return t;
|
|
8
8
|
const n = String(e), r = t.indexOf(n);
|
|
9
9
|
return r === -1 ? t : t.slice(r + n.length);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function ft(t, e) {
|
|
12
12
|
if (e === "")
|
|
13
13
|
return t;
|
|
14
14
|
const n = t.lastIndexOf(String(e));
|
|
15
15
|
return n === -1 ? t : t.slice(n + String(e).length);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function V(t, e) {
|
|
18
18
|
if (e === "")
|
|
19
19
|
return t;
|
|
20
20
|
const n = t.indexOf(String(e));
|
|
@@ -26,70 +26,70 @@ function X(t, e) {
|
|
|
26
26
|
const n = t.lastIndexOf(String(e));
|
|
27
27
|
return n === -1 ? t : x(t, 0, n);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return e === "" || n === "" ? t : X(
|
|
29
|
+
function at(t, e, n) {
|
|
30
|
+
return e === "" || n === "" ? t : X(T(t, e), n);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return e === "" || n === "" ? t :
|
|
32
|
+
function ut(t, e, n) {
|
|
33
|
+
return e === "" || n === "" ? t : V(T(t, e), n);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function pt(t) {
|
|
36
36
|
if (E.has(t))
|
|
37
37
|
return E.get(t);
|
|
38
|
-
const e =
|
|
38
|
+
const e = rt(H(t));
|
|
39
39
|
return E.set(t, e), e;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function gt(t, e) {
|
|
42
42
|
const n = t.length;
|
|
43
43
|
return (e < 0 ? e < -n : e > n - 1) ? !1 : (e < 0 && (e += n), t.charAt(e));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function mt(t, e) {
|
|
46
46
|
for (const n of S(e) ? e : [e])
|
|
47
47
|
if (n !== "" && t.startsWith(n)) {
|
|
48
|
-
const r = [...t],
|
|
49
|
-
return r.slice(
|
|
48
|
+
const r = [...t], o = [...n];
|
|
49
|
+
return r.slice(o.length).join("");
|
|
50
50
|
}
|
|
51
51
|
return t;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ht(t, e) {
|
|
54
54
|
for (const n of S(e) ? e : [e])
|
|
55
55
|
if (n !== "" && t.endsWith(n)) {
|
|
56
|
-
const r = [...t],
|
|
57
|
-
return r.slice(0, -
|
|
56
|
+
const r = [...t], o = [...n];
|
|
57
|
+
return r.slice(0, -o.length).join("");
|
|
58
58
|
}
|
|
59
59
|
return t;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function B(t, e, n = !1) {
|
|
62
62
|
n && (t = t.toLowerCase());
|
|
63
63
|
let r;
|
|
64
64
|
typeof e == "string" ? r = [e] : r = Array.from(e);
|
|
65
|
-
for (let
|
|
66
|
-
if (n && (
|
|
65
|
+
for (let o of r)
|
|
66
|
+
if (n && (o = o.toLowerCase()), o !== "" && t.includes(o))
|
|
67
67
|
return !0;
|
|
68
68
|
return !1;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const r = n.radius ?? 100,
|
|
72
|
-
if (!
|
|
70
|
+
function dt(t, e = "", n = {}) {
|
|
71
|
+
const r = n.radius ?? 100, o = n.omission ?? "...", s = String(t ?? ""), c = e ?? "", i = (y) => y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(s);
|
|
72
|
+
if (!l)
|
|
73
73
|
return null;
|
|
74
|
-
const
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
function
|
|
74
|
+
const g = q(l[1] ?? ""), u = Array.from(g).length, m = x(g, Math.max(u - r, 0), r);
|
|
75
|
+
let a = q(m);
|
|
76
|
+
a !== g && (a = o + a);
|
|
77
|
+
const p = G(l[3] ?? ""), h = x(p, 0, r);
|
|
78
|
+
let w = G(h);
|
|
79
|
+
w !== p && (w = w + o);
|
|
80
|
+
const d = l[2] ?? "";
|
|
81
|
+
return a + d + w;
|
|
82
|
+
}
|
|
83
|
+
function yt(t, e, n = !1) {
|
|
84
84
|
for (const r of e)
|
|
85
|
-
if (!
|
|
85
|
+
if (!B(t, r, n))
|
|
86
86
|
return !1;
|
|
87
87
|
return !0;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return !
|
|
89
|
+
function wt(t, e, n = !1) {
|
|
90
|
+
return !B(t, e, n);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function xt(t, e = " ") {
|
|
93
93
|
return S(e) ? (e.forEach((n) => {
|
|
94
94
|
t = t.replace(new RegExp(`${n}+`, "g"), n);
|
|
95
95
|
}), t) : t.replace(new RegExp(`${e}+`, "g"), e);
|
|
@@ -103,40 +103,40 @@ function W(t, e) {
|
|
|
103
103
|
return !0;
|
|
104
104
|
return !1;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function St(t, e) {
|
|
107
107
|
return !W(t, e);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function $t(t, e) {
|
|
110
110
|
const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
111
111
|
return t.replace(new RegExp(`(?:${n})+$`, "u"), "") + e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function kt(t, e, n = null) {
|
|
114
114
|
return e + t + (n ?? e);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
116
|
+
function At(t, e, n = null) {
|
|
117
|
+
return U(t, e) && (t = x(t, F(e))), W(t, n ??= e) && (t = x(t, 0, -F(n))), t;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function bt(t, e, n = !1) {
|
|
120
120
|
e = String(e);
|
|
121
121
|
let r;
|
|
122
122
|
typeof t == "string" ? r = [t] : r = Array.from(t);
|
|
123
|
-
for (let
|
|
124
|
-
if (
|
|
123
|
+
for (let o of r) {
|
|
124
|
+
if (o = String(o), o === e || n && O(o) === O(e))
|
|
125
125
|
return !0;
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
if (new RegExp(`^${
|
|
126
|
+
o = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = o.replace(/\\\*/g, ".*");
|
|
127
|
+
const s = n ? "iu" : "u";
|
|
128
|
+
if (new RegExp(`^${o}$`, s).test(e))
|
|
129
129
|
return !0;
|
|
130
130
|
}
|
|
131
131
|
return !1;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Lt(t) {
|
|
134
134
|
for (let e = 0; e < t.length; e++)
|
|
135
135
|
if (t.charCodeAt(e) > 127) return !1;
|
|
136
136
|
return !0;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
if (!
|
|
138
|
+
function Rt(t) {
|
|
139
|
+
if (!N(t))
|
|
140
140
|
return !1;
|
|
141
141
|
try {
|
|
142
142
|
JSON.parse(t);
|
|
@@ -145,17 +145,17 @@ function Et(t) {
|
|
|
145
145
|
}
|
|
146
146
|
return !0;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
if (!
|
|
148
|
+
function Et(t, e = []) {
|
|
149
|
+
if (!N(t))
|
|
150
150
|
return !1;
|
|
151
|
-
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((
|
|
151
|
+
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((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
152
152
|
try {
|
|
153
153
|
const c = new URL(t).protocol.replace(":", "");
|
|
154
154
|
if (r.split("|").includes(c))
|
|
155
155
|
return !0;
|
|
156
156
|
} catch {
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const o = [
|
|
159
159
|
"^(",
|
|
160
160
|
r,
|
|
161
161
|
"):\\/\\/",
|
|
@@ -174,178 +174,178 @@ function Ct(t, e = []) {
|
|
|
174
174
|
"$"
|
|
175
175
|
].join("");
|
|
176
176
|
try {
|
|
177
|
-
return new RegExp(
|
|
177
|
+
return new RegExp(o, "iu").test(t);
|
|
178
178
|
} catch {
|
|
179
179
|
return !1;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
182
|
+
function Ct(t) {
|
|
183
|
+
return nt(t, "-");
|
|
184
184
|
}
|
|
185
185
|
function F(t) {
|
|
186
186
|
return t.length;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Ft(t, e = 100, n = "...", r = !1) {
|
|
189
189
|
if (t.length <= e)
|
|
190
190
|
return t;
|
|
191
191
|
if (!r)
|
|
192
192
|
return t.slice(0, e).replace(/\s+$/, "") + n;
|
|
193
|
-
t =
|
|
194
|
-
const
|
|
195
|
-
return t.substring(e, e + 1) === " " ?
|
|
193
|
+
t = et(t).replace(/[\n\r]+/g, " ").trim();
|
|
194
|
+
const o = t.slice(0, e).replace(/\s+$/, "");
|
|
195
|
+
return t.substring(e, e + 1) === " " ? o + n : o.replace(/(.*)\s.*/, "$1") + n;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
197
|
+
function J(t) {
|
|
198
|
+
return O(t);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function zt(t, e = 100, n = "...") {
|
|
201
201
|
if (e <= 0)
|
|
202
202
|
return t;
|
|
203
|
-
const r = e,
|
|
204
|
-
return !
|
|
203
|
+
const r = e, o = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), s = t.match(o);
|
|
204
|
+
return !s || F(t) === F(s[0]) ? t : s[0].replace(/\s+$/, "") + n;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function _t(t, e, n, r = null) {
|
|
207
207
|
if (e === "")
|
|
208
208
|
return t;
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
n < 0 && (
|
|
209
|
+
const o = t.length;
|
|
210
|
+
let s = n;
|
|
211
|
+
n < 0 && (s = n < -o ? 0 : o + n);
|
|
212
212
|
const c = t.slice(
|
|
213
|
-
|
|
214
|
-
r !== null ?
|
|
213
|
+
s,
|
|
214
|
+
r !== null ? s + r : void 0
|
|
215
215
|
);
|
|
216
216
|
if (c === "")
|
|
217
217
|
return t;
|
|
218
|
-
const i = t.slice(0,
|
|
219
|
-
return i + e.slice(0, 1).repeat(
|
|
218
|
+
const i = t.slice(0, s), f = c.length, l = t.slice(s + f);
|
|
219
|
+
return i + e.slice(0, 1).repeat(f) + l;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Mt(t, e) {
|
|
222
222
|
let n = "u", r = t;
|
|
223
223
|
if (t.length >= 2 && t[0] === "/") {
|
|
224
|
-
let
|
|
225
|
-
for (let
|
|
226
|
-
if (t[
|
|
224
|
+
let o = -1;
|
|
225
|
+
for (let s = t.length - 1; s > 0; s--)
|
|
226
|
+
if (t[s] === "/") {
|
|
227
227
|
let c = 0;
|
|
228
|
-
for (let i =
|
|
228
|
+
for (let i = s - 1; i >= 0 && t[i] === "\\"; i--)
|
|
229
229
|
c++;
|
|
230
230
|
if (c % 2 === 0) {
|
|
231
|
-
|
|
231
|
+
o = s;
|
|
232
232
|
break;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
if (
|
|
236
|
-
r = t.slice(1,
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
for (const c of
|
|
235
|
+
if (o > 0) {
|
|
236
|
+
r = t.slice(1, o);
|
|
237
|
+
const s = t.slice(o + 1);
|
|
238
|
+
if (s)
|
|
239
|
+
for (const c of s)
|
|
240
240
|
/[imsuy]/.test(c) && !n.includes(c) && (n += c);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
try {
|
|
244
|
-
const
|
|
245
|
-
return
|
|
244
|
+
const s = new RegExp(r, n).exec(e);
|
|
245
|
+
return s ? s[1] !== void 0 ? s[1] : s[0] : "";
|
|
246
246
|
} catch {
|
|
247
247
|
return "";
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Ot(t, e) {
|
|
251
251
|
e = String(e);
|
|
252
252
|
const n = typeof t == "string" ? [t] : Array.from(t);
|
|
253
253
|
for (const r of n) {
|
|
254
254
|
if (typeof r != "string" || r === "") continue;
|
|
255
|
-
let
|
|
255
|
+
let o = "u", s = r;
|
|
256
256
|
if (r.length >= 2 && r[0] === "/") {
|
|
257
257
|
let c = -1;
|
|
258
258
|
for (let i = r.length - 1; i > 0; i--)
|
|
259
259
|
if (r[i] === "/") {
|
|
260
|
-
let
|
|
261
|
-
for (let
|
|
262
|
-
|
|
263
|
-
if (
|
|
260
|
+
let f = 0;
|
|
261
|
+
for (let l = i - 1; l >= 0 && r[l] === "\\"; l--)
|
|
262
|
+
f++;
|
|
263
|
+
if (f % 2 === 0) {
|
|
264
264
|
c = i;
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
if (c > 0) {
|
|
269
|
-
|
|
269
|
+
s = r.slice(1, c);
|
|
270
270
|
const i = r.slice(c + 1);
|
|
271
271
|
if (i)
|
|
272
|
-
for (const
|
|
273
|
-
/[imsuy]/.test(
|
|
272
|
+
for (const f of i)
|
|
273
|
+
/[imsuy]/.test(f) && !o.includes(f) && (o += f);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
try {
|
|
277
|
-
if (new RegExp(
|
|
277
|
+
if (new RegExp(s, o).test(e))
|
|
278
278
|
return !0;
|
|
279
279
|
} catch {
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
return !1;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Nt(t, e) {
|
|
285
285
|
let n = "u", r = t;
|
|
286
286
|
if (t.length >= 2 && t[0] === "/") {
|
|
287
|
-
let
|
|
287
|
+
let s = -1;
|
|
288
288
|
for (let c = t.length - 1; c > 0; c--)
|
|
289
289
|
if (t[c] === "/") {
|
|
290
290
|
let i = 0;
|
|
291
|
-
for (let
|
|
291
|
+
for (let f = c - 1; f >= 0 && t[f] === "\\"; f--)
|
|
292
292
|
i++;
|
|
293
293
|
if (i % 2 === 0) {
|
|
294
|
-
|
|
294
|
+
s = c;
|
|
295
295
|
break;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
299
|
-
r = t.slice(1,
|
|
300
|
-
const c = t.slice(
|
|
298
|
+
if (s > 0) {
|
|
299
|
+
r = t.slice(1, s);
|
|
300
|
+
const c = t.slice(s + 1);
|
|
301
301
|
if (c)
|
|
302
302
|
for (const i of c)
|
|
303
303
|
/[imsuy]/.test(i) && !n.includes(i) && (n += i);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
n.includes("g") || (n += "g");
|
|
307
|
-
let
|
|
307
|
+
let o = [];
|
|
308
308
|
try {
|
|
309
|
-
const
|
|
309
|
+
const s = new RegExp(r, n);
|
|
310
310
|
let c;
|
|
311
|
-
for (; (c =
|
|
312
|
-
|
|
311
|
+
for (; (c = s.exec(e)) !== null; )
|
|
312
|
+
o.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && s.lastIndex++;
|
|
313
313
|
} catch {
|
|
314
|
-
|
|
314
|
+
o = [];
|
|
315
315
|
}
|
|
316
|
-
return
|
|
316
|
+
return o;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Wt(t) {
|
|
319
319
|
return S(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ut(t, e, n = " ") {
|
|
322
322
|
const r = t.length;
|
|
323
323
|
if (e <= r || n === "")
|
|
324
324
|
return t;
|
|
325
|
-
const
|
|
326
|
-
return z(n,
|
|
325
|
+
const o = e - r, s = Math.floor(o / 2), c = o - s;
|
|
326
|
+
return z(n, s) + t + z(n, c);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function It(t, e, n = " ") {
|
|
329
329
|
const r = t.length;
|
|
330
330
|
if (e <= r || n === "")
|
|
331
331
|
return t;
|
|
332
|
-
const
|
|
333
|
-
return z(n,
|
|
332
|
+
const s = e - r;
|
|
333
|
+
return z(n, s) + t;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function qt(t, e, n = " ") {
|
|
336
336
|
const r = t.length;
|
|
337
337
|
if (e <= r || n === "")
|
|
338
338
|
return t;
|
|
339
|
-
const
|
|
340
|
-
return t + z(n,
|
|
339
|
+
const s = e - r;
|
|
340
|
+
return t + z(n, s);
|
|
341
341
|
}
|
|
342
342
|
function z(t, e) {
|
|
343
343
|
if (e <= 0) return "";
|
|
344
344
|
const n = Math.ceil(e / t.length);
|
|
345
345
|
return t.repeat(n).slice(0, e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
347
|
+
function Gt(t = 32, e = !0, n = !0, r = !0, o = !1) {
|
|
348
|
+
const l = [
|
|
349
349
|
e ? [
|
|
350
350
|
"a",
|
|
351
351
|
"b",
|
|
@@ -429,82 +429,82 @@ function Pt(t = 32, e = !0, n = !0, r = !0, s = !1) {
|
|
|
429
429
|
":",
|
|
430
430
|
";"
|
|
431
431
|
] : null,
|
|
432
|
-
|
|
433
|
-
].filter((
|
|
434
|
-
if (
|
|
432
|
+
o ? [" "] : null
|
|
433
|
+
].filter((a) => S(a));
|
|
434
|
+
if (l.length === 0 || t <= 0)
|
|
435
435
|
return "";
|
|
436
|
-
const
|
|
437
|
-
for (const
|
|
438
|
-
const
|
|
439
|
-
|
|
436
|
+
const g = [];
|
|
437
|
+
for (const a of l) {
|
|
438
|
+
const p = M(0, a.length - 1);
|
|
439
|
+
g.push(a[p]);
|
|
440
440
|
}
|
|
441
|
-
const u = Math.max(0, t -
|
|
442
|
-
for (let
|
|
443
|
-
const
|
|
444
|
-
|
|
441
|
+
const u = Math.max(0, t - g.length), m = l.flat();
|
|
442
|
+
for (let a = 0; a < u; a++) {
|
|
443
|
+
const p = M(0, m.length - 1);
|
|
444
|
+
g.push(m[p]);
|
|
445
445
|
}
|
|
446
|
-
for (let
|
|
447
|
-
const
|
|
448
|
-
|
|
446
|
+
for (let a = g.length - 1; a > 0; a--) {
|
|
447
|
+
const p = M(0, a), h = g[a];
|
|
448
|
+
g[a] = g[p], g[p] = h;
|
|
449
449
|
}
|
|
450
|
-
return
|
|
450
|
+
return g.join("");
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Pt(t, e, n = 0) {
|
|
453
453
|
if (e === "")
|
|
454
454
|
return !1;
|
|
455
|
-
const r = Array.from(t),
|
|
456
|
-
let
|
|
457
|
-
if (
|
|
455
|
+
const r = Array.from(t), o = Array.from(e);
|
|
456
|
+
let s = n >= 0 ? n : r.length + n;
|
|
457
|
+
if (s < 0 && (s = 0), s >= r.length)
|
|
458
458
|
return !1;
|
|
459
|
-
const c = r.length -
|
|
460
|
-
for (let i =
|
|
461
|
-
let
|
|
462
|
-
for (let
|
|
463
|
-
if (r[i +
|
|
464
|
-
|
|
459
|
+
const c = r.length - o.length;
|
|
460
|
+
for (let i = s; i <= c; i++) {
|
|
461
|
+
let f = !0;
|
|
462
|
+
for (let l = 0; l < o.length; l++)
|
|
463
|
+
if (r[i + l] !== o[l]) {
|
|
464
|
+
f = !1;
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
|
-
if (
|
|
467
|
+
if (f)
|
|
468
468
|
return i;
|
|
469
469
|
}
|
|
470
470
|
return !1;
|
|
471
471
|
}
|
|
472
472
|
function Y(t = 16) {
|
|
473
|
-
return (b ?? ((n) =>
|
|
473
|
+
return (b ?? ((n) => K(n)))(t);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function j(t) {
|
|
476
476
|
b = t;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Tt(t, e) {
|
|
479
479
|
let n = 0;
|
|
480
|
-
const r = e ?? function(
|
|
481
|
-
const
|
|
480
|
+
const r = e ?? function(o) {
|
|
481
|
+
const s = b;
|
|
482
482
|
b = null;
|
|
483
|
-
const c = Y(
|
|
484
|
-
return b =
|
|
483
|
+
const c = Y(o);
|
|
484
|
+
return b = s, n++, c;
|
|
485
485
|
};
|
|
486
|
-
|
|
486
|
+
j((o) => n < t.length ? String(t[n++]) : r(o));
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Bt() {
|
|
489
489
|
b = null;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Jt(t, e) {
|
|
492
492
|
return e <= 0 ? "" : t.repeat(e);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Ht(t, e, n) {
|
|
495
495
|
let r;
|
|
496
496
|
typeof e == "object" && !S(e) ? r = Object.values(e) : r = S(e) ? [...e] : Array.from(e);
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
497
|
+
const o = n.split(t);
|
|
498
|
+
if (o.length === 1)
|
|
499
499
|
return n;
|
|
500
|
-
let
|
|
501
|
-
for (let c = 1; c <
|
|
500
|
+
let s = o[0];
|
|
501
|
+
for (let c = 1; c < o.length; c++) {
|
|
502
502
|
const i = r.length ? r.shift() : t;
|
|
503
|
-
|
|
503
|
+
s += i + o[c];
|
|
504
504
|
}
|
|
505
|
-
return String(
|
|
505
|
+
return String(s);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Kt(t, e) {
|
|
508
508
|
try {
|
|
509
509
|
const n = String(t);
|
|
510
510
|
if (n.length)
|
|
@@ -514,159 +514,159 @@ function Zt(t, e) {
|
|
|
514
514
|
return e;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
if (u === "") return
|
|
520
|
-
const
|
|
517
|
+
function Zt(t, e, n, r = !0) {
|
|
518
|
+
const o = (l) => typeof l == "string" ? [l] : Array.from(l), s = o(t), c = o(e), i = (l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = (l) => s.reduce((g, u, m) => {
|
|
519
|
+
if (u === "") return g;
|
|
520
|
+
const a = c[m] ?? "";
|
|
521
521
|
if (!r)
|
|
522
|
-
return
|
|
523
|
-
const
|
|
524
|
-
return
|
|
525
|
-
},
|
|
526
|
-
return
|
|
522
|
+
return g.split(u).join(a);
|
|
523
|
+
const p = new RegExp(i(u), "gi");
|
|
524
|
+
return g.replace(p, () => a);
|
|
525
|
+
}, l);
|
|
526
|
+
return N(n) ? f(n) : Array.from(n).map(f);
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function v(t, e, n) {
|
|
529
529
|
if (t = String(t), t === "")
|
|
530
530
|
return n;
|
|
531
531
|
const r = n.indexOf(t);
|
|
532
532
|
return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
return t = String(t), t === "" ? n :
|
|
534
|
+
function Dt(t, e, n) {
|
|
535
|
+
return t = String(t), t === "" ? n : U(n, t) ? v(t, e, n) : n;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function tt(t, e, n) {
|
|
538
538
|
if (t = String(t), t === "")
|
|
539
539
|
return n;
|
|
540
540
|
const r = n.lastIndexOf(t);
|
|
541
541
|
return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
return t = String(t), t === "" ? n : W(n, t) ?
|
|
543
|
+
function Qt(t, e, n) {
|
|
544
|
+
return t = String(t), t === "" ? n : W(n, t) ? tt(t, e, n) : n;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
const
|
|
546
|
+
function Vt(t, e, n, r = -1) {
|
|
547
|
+
const o = (u) => S(u) ? u : [u], s = o(t);
|
|
548
548
|
function c(u) {
|
|
549
549
|
try {
|
|
550
550
|
if (u instanceof RegExp) {
|
|
551
|
-
let
|
|
552
|
-
return
|
|
551
|
+
let p = u.flags;
|
|
552
|
+
return p.includes("g") || (p += "g"), p.includes("u") || (p += "u"), new RegExp(u.source, p);
|
|
553
553
|
}
|
|
554
|
-
let
|
|
554
|
+
let m = u, a = "gu";
|
|
555
555
|
if (u.length >= 2 && u[0] === "/") {
|
|
556
|
-
let
|
|
556
|
+
let p = -1;
|
|
557
557
|
for (let h = u.length - 1; h > 0; h--)
|
|
558
558
|
if (u[h] === "/") {
|
|
559
|
-
let
|
|
560
|
-
for (let
|
|
561
|
-
|
|
562
|
-
if (
|
|
563
|
-
|
|
559
|
+
let w = 0;
|
|
560
|
+
for (let d = h - 1; d >= 0 && u[d] === "\\"; d--)
|
|
561
|
+
w++;
|
|
562
|
+
if (w % 2 === 0) {
|
|
563
|
+
p = h;
|
|
564
564
|
break;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
const h = u.slice(
|
|
567
|
+
if (p > 1) {
|
|
568
|
+
m = u.slice(1, p);
|
|
569
|
+
const h = u.slice(p + 1);
|
|
570
570
|
if (h)
|
|
571
|
-
for (const
|
|
572
|
-
/[imsuy]/.test(
|
|
573
|
-
|
|
571
|
+
for (const w of h)
|
|
572
|
+
/[imsuy]/.test(w) && !a.includes(w) && (a += w);
|
|
573
|
+
a.includes("g") || (a += "g"), a.includes("u") || (a += "u");
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
return new RegExp(
|
|
577
|
-
|
|
578
|
-
Array.from(new Set(
|
|
577
|
+
m,
|
|
578
|
+
Array.from(new Set(a.split(""))).join("")
|
|
579
579
|
);
|
|
580
580
|
} catch {
|
|
581
581
|
return null;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
const i = [];
|
|
585
|
-
for (const u of
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
588
|
-
i.push(
|
|
585
|
+
for (const u of s) {
|
|
586
|
+
const m = c(u);
|
|
587
|
+
if (!m) return null;
|
|
588
|
+
i.push(m);
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
let
|
|
592
|
-
for (let
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
590
|
+
const f = Q(e), l = f ? [] : o(e), g = (u) => {
|
|
591
|
+
let m = u;
|
|
592
|
+
for (let a = 0; a < i.length; a++) {
|
|
593
|
+
const p = i[a];
|
|
594
|
+
if (f) {
|
|
595
595
|
let h = 0;
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
(
|
|
600
|
-
if (r >= 0 && h >= r) return
|
|
596
|
+
const w = e;
|
|
597
|
+
m = m.replace(
|
|
598
|
+
p,
|
|
599
|
+
(d, ...y) => {
|
|
600
|
+
if (r >= 0 && h >= r) return d;
|
|
601
601
|
h++;
|
|
602
|
-
const L = typeof
|
|
602
|
+
const L = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, $ = [];
|
|
603
603
|
for (let k = 0; k < L; k++)
|
|
604
|
-
$.push(
|
|
605
|
-
const A = [
|
|
606
|
-
return
|
|
604
|
+
$.push(y[k]);
|
|
605
|
+
const A = [d, ...$];
|
|
606
|
+
return w(A);
|
|
607
607
|
}
|
|
608
608
|
);
|
|
609
609
|
} else {
|
|
610
|
-
const h =
|
|
610
|
+
const h = l[a] ?? (l.length === 1 ? l[0] : "");
|
|
611
611
|
if (r < 0)
|
|
612
|
-
|
|
613
|
-
const _ = typeof
|
|
612
|
+
m = m.replace(p, (w, ...d) => {
|
|
613
|
+
const _ = typeof d[d.length - 1] == "object" && typeof d[d.length - 2] == "number" ? d.length - 3 : d.length - 2, L = d.slice(0, _).map(($) => String($));
|
|
614
614
|
return h.replace(/\$(\d{1,2})/g, ($, A) => {
|
|
615
615
|
const k = parseInt(A, 10);
|
|
616
616
|
return (L[k - 1] ?? "").toUpperCase();
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
else {
|
|
620
|
-
let
|
|
621
|
-
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
const L = typeof
|
|
620
|
+
let w = 0;
|
|
621
|
+
m = m.replace(p, (d, ...y) => {
|
|
622
|
+
if (w >= r) return d;
|
|
623
|
+
w++;
|
|
624
|
+
const L = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, $ = y.slice(0, L).map((A) => String(A));
|
|
625
625
|
return h.replace(/\$(\d{1,2})/g, (A, k) => {
|
|
626
|
-
const
|
|
627
|
-
return ($[
|
|
626
|
+
const I = parseInt(k, 10);
|
|
627
|
+
return ($[I - 1] ?? "").toUpperCase();
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
return
|
|
633
|
+
return m;
|
|
634
634
|
};
|
|
635
|
-
return S(n) ? n.map(
|
|
635
|
+
return S(n) ? n.map(g) : g(n);
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function et(t) {
|
|
638
638
|
return t.replace(/<\/?[^>]+(>|$)/g, "");
|
|
639
639
|
}
|
|
640
640
|
function Xt(t, e, n = !0) {
|
|
641
|
-
const r = typeof t == "string" ? [t] : Array.from(t),
|
|
641
|
+
const r = typeof t == "string" ? [t] : Array.from(t), o = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = (c) => {
|
|
642
642
|
let i = c;
|
|
643
|
-
for (const
|
|
644
|
-
if (
|
|
643
|
+
for (const f of r)
|
|
644
|
+
if (f !== "")
|
|
645
645
|
if (n)
|
|
646
|
-
i = i.split(
|
|
646
|
+
i = i.split(f).join("");
|
|
647
647
|
else {
|
|
648
|
-
const
|
|
649
|
-
i = i.replace(
|
|
648
|
+
const l = new RegExp(o(f), "gi");
|
|
649
|
+
i = i.replace(l, "");
|
|
650
650
|
}
|
|
651
651
|
return i;
|
|
652
652
|
};
|
|
653
|
-
return typeof e == "string" ?
|
|
653
|
+
return typeof e == "string" ? s(e) : Array.from(e, (c) => s(String(c)));
|
|
654
654
|
}
|
|
655
655
|
function Yt(t) {
|
|
656
656
|
return Array.from(t).reverse().join("");
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function jt(t, e) {
|
|
659
659
|
const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
660
660
|
return e + t.replace(new RegExp(`^(?:${n})+`, "u"), "");
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function vt(t) {
|
|
663
663
|
const e = String(t).trim();
|
|
664
664
|
if (e === "")
|
|
665
665
|
return "";
|
|
666
666
|
let n = e.split(/\s+/u);
|
|
667
|
-
return n.length > 1 ? n = n.map((
|
|
667
|
+
return n.length > 1 ? n = n.map((o) => P(o)) : n = st(n.join("_")).map((o) => P(o)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((o) => o.length > 0).join(" ");
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function te(t) {
|
|
670
670
|
if (t.trim() === "")
|
|
671
671
|
return t;
|
|
672
672
|
const e = /* @__PURE__ */ new Set([
|
|
@@ -705,71 +705,34 @@ function ee(t) {
|
|
|
705
705
|
"des",
|
|
706
706
|
"par",
|
|
707
707
|
"à"
|
|
708
|
-
]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u),
|
|
709
|
-
if (!
|
|
710
|
-
const c = Array.from(
|
|
711
|
-
return i +
|
|
708
|
+
]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), o = (s) => {
|
|
709
|
+
if (!s) return s;
|
|
710
|
+
const c = Array.from(s), i = c[0].toLocaleUpperCase(), f = c.slice(1).join("");
|
|
711
|
+
return i + f;
|
|
712
712
|
};
|
|
713
|
-
for (let
|
|
714
|
-
const c = r[
|
|
713
|
+
for (let s = 0; s < r.length; s++) {
|
|
714
|
+
const c = r[s].toLocaleLowerCase();
|
|
715
715
|
if (c.includes("-")) {
|
|
716
|
-
const
|
|
717
|
-
r[
|
|
716
|
+
const f = c.split("-").map((l) => e.has(l) && l.length <= 3 ? l : o(l));
|
|
717
|
+
r[s] = f.join("-");
|
|
718
718
|
} else {
|
|
719
|
-
const i =
|
|
720
|
-
e.has(c) && c.length <= 3 && !
|
|
719
|
+
const i = s > 0 ? r[s - 1] : "", f = i ? Array.from(i).slice(-1)[0] : void 0, l = s === 0 || f !== void 0 && n.has(f);
|
|
720
|
+
e.has(c) && c.length <= 3 && !l ? r[s] = c : r[s] = o(c);
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
return r.join(" ");
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const r = e, s = (u) => u.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), o = (u) => u.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = (u) => {
|
|
727
|
-
let a = u;
|
|
728
|
-
const p = r === "-" ? "_" : "-";
|
|
729
|
-
{
|
|
730
|
-
const g = new RegExp(`[${s(p)}]+`, "gu");
|
|
731
|
-
a = a.replace(g, r);
|
|
732
|
-
}
|
|
733
|
-
if (n && typeof n == "object") {
|
|
734
|
-
const g = {};
|
|
735
|
-
for (const [h, d] of Object.entries(n))
|
|
736
|
-
g[h] = (r ?? "") + d + (r ?? "");
|
|
737
|
-
for (const [h, d] of Object.entries(g))
|
|
738
|
-
h !== "" && (a = a.split(h).join(d));
|
|
739
|
-
}
|
|
740
|
-
if (a = U(a), r === "")
|
|
741
|
-
return a = a.replace(/[^\p{L}\p{N}\s]+/gu, ""), a = a.replace(/[\s]+/gu, ""), a;
|
|
742
|
-
{
|
|
743
|
-
const g = new RegExp(
|
|
744
|
-
`[^${s(r)}\\p{L}\\p{N}\\s]+`,
|
|
745
|
-
"gu"
|
|
746
|
-
);
|
|
747
|
-
a = a.replace(g, "");
|
|
748
|
-
const h = new RegExp(
|
|
749
|
-
`[${s(r)}\\s]+`,
|
|
750
|
-
"gu"
|
|
751
|
-
);
|
|
752
|
-
a = a.replace(h, r);
|
|
753
|
-
const d = new RegExp(
|
|
754
|
-
`^${o(r)}+|${o(r)}+$`,
|
|
755
|
-
"gu"
|
|
756
|
-
);
|
|
757
|
-
return a = a.replace(d, ""), a;
|
|
758
|
-
}
|
|
759
|
-
}, i = c(t), l = c(Z(t));
|
|
760
|
-
return Object.keys(n || {}).some((u) => /[A-Za-z0-9]/.test(u)) ? l : i;
|
|
761
|
-
}
|
|
762
|
-
function rt(t, e = "_") {
|
|
725
|
+
function nt(t, e = "_") {
|
|
763
726
|
const r = `${t}|${e}`;
|
|
764
727
|
if (R.has(r))
|
|
765
728
|
return R.get(r);
|
|
766
|
-
let
|
|
767
|
-
return /^[a-z]+$/.test(t) || (
|
|
729
|
+
let o = t;
|
|
730
|
+
return /^[a-z]+$/.test(t) || (o = ot(t).replace(/\s+/gu, ""), o = o.replace(/(.)(?=[A-Z])/g, `$1${e}`), o = J(o)), R.set(r, o), o;
|
|
768
731
|
}
|
|
769
|
-
function
|
|
770
|
-
return
|
|
732
|
+
function ee(t) {
|
|
733
|
+
return Z(t).replace(/[\s\u3164\u1160]+/gu, " ");
|
|
771
734
|
}
|
|
772
|
-
function
|
|
735
|
+
function U(t, e) {
|
|
773
736
|
if (t == null || e == null)
|
|
774
737
|
return !1;
|
|
775
738
|
let n = [
|
|
@@ -777,201 +740,200 @@ function I(t, e) {
|
|
|
777
740
|
];
|
|
778
741
|
typeof e == "string" || typeof e == "number" ? n = [e] : Symbol.iterator in Object(e) && (n = Array.from(e));
|
|
779
742
|
const r = String(t);
|
|
780
|
-
for (const
|
|
781
|
-
if (
|
|
743
|
+
for (const o of n) {
|
|
744
|
+
if (o == null)
|
|
782
745
|
continue;
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
746
|
+
const s = String(o);
|
|
747
|
+
if (s !== "" && r.startsWith(s))
|
|
785
748
|
return !0;
|
|
786
749
|
}
|
|
787
750
|
return !1;
|
|
788
751
|
}
|
|
789
|
-
function
|
|
790
|
-
return !
|
|
752
|
+
function ne(t, e) {
|
|
753
|
+
return !U(t, e);
|
|
791
754
|
}
|
|
792
|
-
function
|
|
755
|
+
function H(t) {
|
|
793
756
|
const e = t;
|
|
794
757
|
if (C.has(e))
|
|
795
758
|
return C.get(e);
|
|
796
|
-
const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u),
|
|
759
|
+
const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u), o = (c) => {
|
|
797
760
|
if (!c) return c;
|
|
798
|
-
const i = Array.from(c),
|
|
799
|
-
return
|
|
800
|
-
},
|
|
801
|
-
return C.set(e,
|
|
761
|
+
const i = Array.from(c), f = i[0].toUpperCase(), l = i.slice(1).join("");
|
|
762
|
+
return f + l;
|
|
763
|
+
}, s = r.map(o).join("");
|
|
764
|
+
return C.set(e, s), s;
|
|
802
765
|
}
|
|
803
|
-
function
|
|
804
|
-
return
|
|
766
|
+
function re(t) {
|
|
767
|
+
return H(t);
|
|
805
768
|
}
|
|
806
|
-
function
|
|
769
|
+
function se(t, e) {
|
|
807
770
|
if (!t || Object.keys(t).length === 0)
|
|
808
771
|
return e;
|
|
809
|
-
const n = Object.keys(t).filter((
|
|
772
|
+
const n = Object.keys(t).filter((s) => s !== "");
|
|
810
773
|
if (n.length === 0)
|
|
811
774
|
return e;
|
|
812
|
-
n.sort((
|
|
813
|
-
const r = (
|
|
814
|
-
return e.replace(
|
|
775
|
+
n.sort((s, c) => c.length - s.length);
|
|
776
|
+
const r = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(n.map(r).join("|"), "gu");
|
|
777
|
+
return e.replace(o, (s) => t[s] ?? s);
|
|
815
778
|
}
|
|
816
|
-
function
|
|
779
|
+
function oe(t, e) {
|
|
817
780
|
return e < 0 ? x(t, e) : x(t, 0, e);
|
|
818
781
|
}
|
|
819
|
-
function
|
|
820
|
-
return
|
|
782
|
+
function rt(t) {
|
|
783
|
+
return J(x(t, 0, 1)) + x(t, 1);
|
|
821
784
|
}
|
|
822
|
-
function
|
|
823
|
-
return
|
|
785
|
+
function ie(t) {
|
|
786
|
+
return D(x(t, 0, 1)) + x(t, 1);
|
|
824
787
|
}
|
|
825
|
-
function
|
|
788
|
+
function st(t) {
|
|
826
789
|
return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
|
|
827
790
|
}
|
|
828
|
-
function
|
|
791
|
+
function ot(t, e = ` \r
|
|
829
792
|
\f\v`) {
|
|
830
|
-
const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"),
|
|
831
|
-
return t.replace(c, (i,
|
|
793
|
+
const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), o = n.length ? r(n) : "", s = o.length ? `(?:\\s|[${o}])` : "\\s", c = new RegExp(`(^|${s})(\\p{Ll})`, "gu");
|
|
794
|
+
return t.replace(c, (i, f, l) => f + l.toUpperCase());
|
|
832
795
|
}
|
|
833
|
-
function
|
|
834
|
-
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,
|
|
835
|
-
return
|
|
796
|
+
function ce(t, e = null) {
|
|
797
|
+
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, o = t.match(r);
|
|
798
|
+
return o ? o.length : 0;
|
|
836
799
|
}
|
|
837
|
-
function
|
|
800
|
+
function le(t, e = 75, n = `
|
|
838
801
|
`, r = !1) {
|
|
839
802
|
if (t.length === 0 || e < 1 || n === "")
|
|
840
803
|
return t;
|
|
841
|
-
const
|
|
842
|
-
for (const c of
|
|
804
|
+
const o = t.split(/\r\n|\n|\r/), s = [];
|
|
805
|
+
for (const c of o) {
|
|
843
806
|
let i = c;
|
|
844
807
|
if (i.length === 0) {
|
|
845
|
-
|
|
808
|
+
s.push("");
|
|
846
809
|
continue;
|
|
847
810
|
}
|
|
848
811
|
if (r) {
|
|
849
812
|
for (; i.length > 0 && !(/^\s/u.test(i) && (i = i.replace(/^\s+/u, ""), i.length === 0)); ) {
|
|
850
813
|
if (i.length <= e) {
|
|
851
|
-
|
|
814
|
+
s.push(i), i = "";
|
|
852
815
|
break;
|
|
853
816
|
}
|
|
854
|
-
let
|
|
855
|
-
|
|
817
|
+
let f = i.slice(0, e);
|
|
818
|
+
f = f.replace(/\s+$/u, ""), s.push(f), i = i.slice(e).replace(/^\s+/u, "");
|
|
856
819
|
}
|
|
857
820
|
continue;
|
|
858
821
|
}
|
|
859
822
|
for (; i.length > e; ) {
|
|
860
|
-
const
|
|
861
|
-
if (
|
|
823
|
+
const f = i.replace(/^\s+/u, "");
|
|
824
|
+
if (f.length !== i.length && (i = f, i.length <= e))
|
|
862
825
|
break;
|
|
863
|
-
const
|
|
864
|
-
let
|
|
865
|
-
for (let
|
|
866
|
-
if (/\s/u.test(
|
|
867
|
-
|
|
826
|
+
const l = i.slice(0, e + 1);
|
|
827
|
+
let g = -1;
|
|
828
|
+
for (let m = l.length - 1; m >= 0; m--)
|
|
829
|
+
if (/\s/u.test(l[m])) {
|
|
830
|
+
g = m;
|
|
868
831
|
break;
|
|
869
832
|
}
|
|
870
|
-
if (
|
|
871
|
-
|
|
833
|
+
if (g > 0) {
|
|
834
|
+
s.push(i.slice(0, g)), i = i.slice(g + 1);
|
|
872
835
|
continue;
|
|
873
836
|
}
|
|
874
837
|
const u = i.search(/\s/u);
|
|
875
838
|
if (u >= 0) {
|
|
876
|
-
|
|
839
|
+
s.push(i.slice(0, u)), i = i.slice(u + 1);
|
|
877
840
|
continue;
|
|
878
841
|
}
|
|
879
|
-
|
|
842
|
+
s.push(i), i = "";
|
|
880
843
|
break;
|
|
881
844
|
}
|
|
882
|
-
i.length > 0 &&
|
|
845
|
+
i.length > 0 && s.push(i);
|
|
883
846
|
}
|
|
884
|
-
return
|
|
847
|
+
return s.join(n);
|
|
885
848
|
}
|
|
886
|
-
function
|
|
849
|
+
function fe() {
|
|
887
850
|
return R.size;
|
|
888
851
|
}
|
|
889
|
-
function
|
|
852
|
+
function ae() {
|
|
890
853
|
return E.size;
|
|
891
854
|
}
|
|
892
|
-
function
|
|
855
|
+
function ue() {
|
|
893
856
|
return C.size;
|
|
894
857
|
}
|
|
895
|
-
function
|
|
858
|
+
function pe() {
|
|
896
859
|
R.clear(), E.clear(), C.clear();
|
|
897
860
|
}
|
|
898
861
|
export {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
862
|
+
T as after,
|
|
863
|
+
ft as afterLast,
|
|
864
|
+
te as apa,
|
|
865
|
+
V as before,
|
|
903
866
|
X as beforeLast,
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
867
|
+
at as between,
|
|
868
|
+
ut as betweenFirst,
|
|
869
|
+
pt as camel,
|
|
870
|
+
ae as camelCacheSize,
|
|
871
|
+
gt as charAt,
|
|
872
|
+
ht as chopEnd,
|
|
873
|
+
mt as chopStart,
|
|
874
|
+
B as contains,
|
|
875
|
+
yt as containsAll,
|
|
876
|
+
Bt as createRandomStringsNormally,
|
|
877
|
+
j as createRandomStringsUsing,
|
|
878
|
+
Tt as createRandomStringsUsingSequence,
|
|
879
|
+
xt as deduplicate,
|
|
880
|
+
wt as doesntContain,
|
|
881
|
+
St as doesntEndWith,
|
|
882
|
+
ne as doesntStartWith,
|
|
920
883
|
W as endsWith,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
884
|
+
dt as excerpt,
|
|
885
|
+
$t as finish,
|
|
886
|
+
pe as flushCache,
|
|
887
|
+
vt as headline,
|
|
888
|
+
bt as is,
|
|
889
|
+
Lt as isAscii,
|
|
890
|
+
Rt as isJson,
|
|
891
|
+
Ot as isMatch,
|
|
892
|
+
Et as isUrl,
|
|
893
|
+
Ct as kebab,
|
|
894
|
+
rt as lcfirst,
|
|
932
895
|
F as length,
|
|
933
|
-
|
|
934
|
-
|
|
896
|
+
Ft as limit,
|
|
897
|
+
J as lower,
|
|
935
898
|
z as makePad,
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
899
|
+
_t as mask,
|
|
900
|
+
Mt as match,
|
|
901
|
+
Nt as matchAll,
|
|
902
|
+
Wt as numbers,
|
|
903
|
+
Ut as padBoth,
|
|
904
|
+
It as padLeft,
|
|
905
|
+
qt as padRight,
|
|
906
|
+
re as pascal,
|
|
907
|
+
Gt as password,
|
|
908
|
+
Pt as position,
|
|
946
909
|
Y as random,
|
|
947
910
|
Xt as remove,
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
911
|
+
Jt as repeat,
|
|
912
|
+
Zt as replace,
|
|
913
|
+
Ht as replaceArray,
|
|
914
|
+
Qt as replaceEnd,
|
|
915
|
+
v as replaceFirst,
|
|
916
|
+
tt as replaceLast,
|
|
917
|
+
Vt as replaceMatches,
|
|
918
|
+
Dt as replaceStart,
|
|
956
919
|
Yt as reverse,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
ot as
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
At as wrap
|
|
920
|
+
nt as snake,
|
|
921
|
+
fe as snakeCacheSize,
|
|
922
|
+
ee as squish,
|
|
923
|
+
jt as start,
|
|
924
|
+
U as startsWith,
|
|
925
|
+
et as stripTags,
|
|
926
|
+
H as studly,
|
|
927
|
+
ue as studlyCacheSize,
|
|
928
|
+
se as swap,
|
|
929
|
+
oe as take,
|
|
930
|
+
Kt as toStringOr,
|
|
931
|
+
ie as ucfirst,
|
|
932
|
+
st as ucsplit,
|
|
933
|
+
ot as ucwords,
|
|
934
|
+
At as unwrap,
|
|
935
|
+
ce as wordCount,
|
|
936
|
+
le as wordWrap,
|
|
937
|
+
zt as words,
|
|
938
|
+
kt as wrap
|
|
977
939
|
};
|