@tolki/str 1.0.9 → 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/dist/str.js CHANGED
@@ -1,67 +1,69 @@
1
- import { isArray as x, toLower as W, isString as _, isFunction as K, isNumber as Z } from "@tolki/utils";
2
- import { title as I, upper as D } from "./convertcase/index.js";
3
- import { randomInt as O, randomString as Q } from "./random/index.js";
4
- import { substr as S } from "./replacer/index.js";
5
- import { ltrim as q, rtrim as G, trim as V } from "./trimmer/index.js";
1
+ import { isArray as S, toLower as U, isString as _, isFunction as Z, isNumber as j } from "@tolki/utils";
2
+ import { title as I, upper as T } from "./convertcase/index.js";
3
+ import { randomInt as O, randomString as D } from "./random/index.js";
4
+ import { substr as x } from "./replacer/index.js";
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
- function T(t, e) {
10
+ function B(t, e) {
9
11
  if (e === "")
10
12
  return t;
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 gt(t, e) {
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 X(t, e) {
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 Y(t, e) {
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 : S(t, 0, n);
32
+ return n === -1 ? t : x(t, 0, n);
31
33
  }
32
- function mt(t, e, n) {
33
- return e === "" || n === "" ? t : Y(T(t, e), n);
34
+ function St(t, e, n) {
35
+ return e === "" || n === "" ? t : v(B(t, e), n);
34
36
  }
35
- function ht(t, e, n) {
36
- return e === "" || n === "" ? t : X(T(t, e), n);
37
+ function xt(t, e, n) {
38
+ return e === "" || n === "" ? t : Y(B(t, e), n);
37
39
  }
38
- function dt(t) {
40
+ function $t(t) {
39
41
  if (C.has(t))
40
42
  return C.get(t);
41
- const e = st(J(t));
43
+ const e = ct(K(t));
42
44
  return C.set(t, e), e;
43
45
  }
44
- function yt(t, e) {
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 wt(t, e) {
49
- for (const n of x(e) ? e : [e])
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 xt(t, e) {
57
- for (const n of x(e) ? e : [e])
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("");
61
63
  }
62
64
  return t;
63
65
  }
64
- function B(t, e, n = !1) {
66
+ function H(t, e, n = !1) {
65
67
  n && (t = t.toLowerCase());
66
68
  let r;
67
69
  typeof e == "string" ? r = [e] : r = Array.from(e);
@@ -70,59 +72,59 @@ function B(t, e, n = !1) {
70
72
  return !0;
71
73
  return !1;
72
74
  }
73
- function St(t, e = "", n = {}) {
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 = S(u, Math.max(m - r, 0), r);
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 = S(h, 0, r);
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 $t(t, e, n = !1) {
86
+ function Lt(t, e, n = !1) {
85
87
  for (const r of e)
86
- if (!B(t, r, n))
88
+ if (!H(t, r, n))
87
89
  return !1;
88
90
  return !0;
89
91
  }
90
- function kt(t, e, n = !1) {
91
- return !B(t, e, n);
92
+ function Rt(t, e, n = !1) {
93
+ return !H(t, e, n);
92
94
  }
93
- function At(t, e = " ") {
94
- return x(e) ? (e.forEach((n) => {
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 M(t, e) {
100
+ function W(t, e) {
99
101
  if (t === null)
100
102
  return !1;
101
- t = String(t), x(e) ? e = Array.from(e) : e = [String(e)];
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 bt(t, e) {
108
- return !M(t, e);
109
+ function Ft(t, e) {
110
+ return !W(t, e);
109
111
  }
110
- function Et(t, e) {
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 Lt(t, e, n = null) {
116
+ function zt(t, e, n = null) {
115
117
  return e + t + (n ?? e);
116
118
  }
117
- function Rt(t, e, n = null) {
118
- return U(t, e) && (t = S(t, z(e))), M(t, n ??= e) && (t = S(t, 0, -z(n))), t;
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 Ct(t, e, n = !1) {
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 && W(s) === W(e))
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 Ft(t) {
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 zt(t) {
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 Nt(t, e = []) {
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 _t(t) {
181
- return rt(t, "-");
182
+ function Pt(t) {
183
+ return it(t, "-");
182
184
  }
183
- function z(t) {
185
+ function N(t) {
184
186
  return t.length;
185
187
  }
186
- function Ot(t, e = 100, n = "...", r = !1) {
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 = nt(t).replace(/[\n\r]+/g, " ").trim();
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
- function H(t) {
196
- return W(t);
197
+ function J(t) {
198
+ return U(t);
197
199
  }
198
- function Wt(t, e = 100, n = "...") {
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 || z(t) === z(o[0]) ? t : o[0].trimEnd() + n;
204
+ return !o || N(t) === N(o[0]) ? t : o[0].trimEnd() + n;
203
205
  }
204
- function Mt(t, e, n, r = null) {
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 Ut(t, e) {
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 Pt(t, e) {
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 It(t, e) {
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 qt(t) {
317
- return x(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
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 Gt(t, e, n = " ") {
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 N(n, o) + t + N(n, c);
326
+ return z(n, o) + t + z(n, c);
325
327
  }
326
- function Tt(t, e, n = " ") {
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 N(n, o) + t;
333
+ return z(n, o) + t;
332
334
  }
333
- function Bt(t, e, n = " ") {
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 + N(n, o);
340
+ return t + z(n, o);
339
341
  }
340
- function N(t, e) {
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 Ht(t = 32, e = !0, n = !0, r = !0, s = !1) {
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) => x(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 Jt(t, e, n = 0) {
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 j(t = 16) {
472
- return (L ?? ((n) => Q(n)))(t);
473
+ function tt(t = 16) {
474
+ return (L ?? ((n) => D(n)))(t);
473
475
  }
474
- function v(t) {
476
+ function et(t) {
475
477
  L = t;
476
478
  }
477
- function Kt(t, e) {
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 = j(s);
484
+ const c = tt(s);
483
485
  return L = o, n++, c;
484
486
  };
485
- v((s) => n < t.length ? String(t[n++]) : r(s));
487
+ et((s) => n < t.length ? String(t[n++]) : r(s));
486
488
  }
487
- function Zt() {
489
+ function nt() {
488
490
  L = null;
489
491
  }
490
- function Dt(t, e) {
492
+ function Xt(t, e) {
491
493
  return e <= 0 ? "" : t.repeat(e);
492
494
  }
493
- function Qt(t, e, n) {
495
+ function Yt(t, e, n) {
494
496
  let r;
495
- typeof e == "object" && !x(e) ? r = Object.values(e) : r = x(e) ? [...e] : Array.from(e);
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 Qt(t, e, n) {
503
505
  }
504
506
  return String(o);
505
507
  }
506
- function Vt(t, e) {
508
+ function vt(t, e) {
507
509
  try {
508
510
  const n = String(t);
509
511
  if (n.length)
@@ -513,7 +515,7 @@ function Vt(t, e) {
513
515
  return e;
514
516
  }
515
517
  }
516
- function Xt(t, e, n, r = !0) {
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 Xt(t, e, n, r = !0) {
524
526
  }, l);
525
527
  return _(n) ? f(n) : Array.from(n).map(f);
526
528
  }
527
- function tt(t, e, n) {
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 Yt(t, e, n) {
534
- return t = String(t), t === "" ? n : U(n, t) ? tt(t, e, n) : 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 et(t, e, n) {
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 jt(t, e, n) {
543
- return t = String(t), t === "" ? n : M(n, t) ? et(t, e, n) : 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 vt(t, e, n, r = -1) {
546
- const s = (a) => x(a) ? a : [a], o = s(t);
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) {
@@ -585,7 +587,7 @@ function vt(t, e, n, r = -1) {
585
587
  if (!g) return null;
586
588
  i.push(g);
587
589
  }
588
- const f = K(e), l = f ? [] : s(e), p = (a) => {
590
+ const f = Z(e), l = f ? [] : s(e), p = (a) => {
589
591
  let g = a;
590
592
  for (let u = 0; u < i.length; u++) {
591
593
  const m = i[u];
@@ -630,9 +632,9 @@ function vt(t, e, n, r = -1) {
630
632
  }
631
633
  return g;
632
634
  };
633
- return x(n) ? n.map(p) : p(n);
635
+ return S(n) ? n.map(p) : p(n);
634
636
  }
635
- function nt(t) {
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 te(t, e, n = !0) {
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,21 +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 ee(t) {
660
+ function oe(t) {
659
661
  return Array.from(t).reverse().join("");
660
662
  }
661
- function ne(t, e) {
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 re(t) {
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 = ot(n.join("_")).map((s) => I(s)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
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(" ");
673
+ }
674
+ function le(t, e = !1) {
675
+ const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
676
+ return e ? T(r) : r;
671
677
  }
672
- function se(t) {
678
+ function fe(t) {
673
679
  if (t.trim() === "")
674
680
  return t;
675
681
  const e = /* @__PURE__ */ new Set([
@@ -725,21 +731,21 @@ function se(t) {
725
731
  }
726
732
  return r.join(" ");
727
733
  }
728
- function rt(t, e = "_") {
734
+ function it(t, e = "_") {
729
735
  const r = `${t}|${e}`;
730
736
  if (R.has(r))
731
737
  return R.get(r);
732
738
  let s = t;
733
- return /^[a-z]+$/.test(t) || (s = it(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${e}`), s = H(s)), R.set(r, s), 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;
734
740
  }
735
- function oe(t) {
736
- return V(t).replace(/[\s\u3164\u1160]+/gu, " ");
741
+ function ae(t) {
742
+ return Q(t).replace(/[\s\u3164\u1160]+/gu, " ");
737
743
  }
738
- function U(t, e) {
744
+ function M(t, e) {
739
745
  if (t == null || e == null)
740
746
  return !1;
741
747
  let n;
742
- _(e) || Z(e) ? n = [e] : Symbol.iterator in Object(e) ? n = Array.from(e) : n = [e];
748
+ _(e) || j(e) ? n = [e] : Symbol.iterator in Object(e) ? n = Array.from(e) : n = [e];
743
749
  const r = String(t);
744
750
  for (const s of n) {
745
751
  if (s == null)
@@ -750,10 +756,10 @@ function U(t, e) {
750
756
  }
751
757
  return !1;
752
758
  }
753
- function ie(t, e) {
754
- return !U(t, e);
759
+ function ue(t, e) {
760
+ return !M(t, e);
755
761
  }
756
- function J(t) {
762
+ function K(t) {
757
763
  const e = t;
758
764
  if (F.has(e))
759
765
  return F.get(e);
@@ -764,10 +770,10 @@ function J(t) {
764
770
  }, o = r.map(s).join("");
765
771
  return F.set(e, o), o;
766
772
  }
767
- function ce(t) {
768
- return J(t);
773
+ function pe(t) {
774
+ return K(t);
769
775
  }
770
- function le(t, e) {
776
+ function ge(t, e) {
771
777
  if (!t || Object.keys(t).length === 0)
772
778
  return e;
773
779
  const n = Object.keys(t).filter((o) => o !== "");
@@ -777,28 +783,28 @@ function le(t, e) {
777
783
  const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(n.map(r).join("|"), "gu");
778
784
  return e.replace(s, (o) => t[o]);
779
785
  }
780
- function fe(t, e) {
781
- return e < 0 ? S(t, e) : S(t, 0, e);
786
+ function me(t, e) {
787
+ return e < 0 ? x(t, e) : x(t, 0, e);
782
788
  }
783
- function st(t) {
784
- return H(S(t, 0, 1)) + S(t, 1);
789
+ function ct(t) {
790
+ return J(x(t, 0, 1)) + x(t, 1);
785
791
  }
786
- function ae(t) {
787
- return D(S(t, 0, 1)) + S(t, 1);
792
+ function he(t) {
793
+ return T(x(t, 0, 1)) + x(t, 1);
788
794
  }
789
- function ot(t) {
795
+ function lt(t) {
790
796
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
791
797
  }
792
- function it(t, e = ` \r
798
+ function ft(t, e = ` \r
793
799
  \f\v`) {
794
- const n = x(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");
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");
795
801
  return t.replace(c, (i, f, l) => f + l.toUpperCase());
796
802
  }
797
- function ue(t, e = null) {
803
+ function de(t, e = null) {
798
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);
799
805
  return s ? s.length : 0;
800
806
  }
801
- function pe(t, e = 75, n = `
807
+ function ye(t, e = 75, n = `
802
808
  `, r = !1) {
803
809
  if (t.length === 0 || e < 1 || n === "")
804
810
  return t;
@@ -847,94 +853,99 @@ function pe(t, e = 75, n = `
847
853
  }
848
854
  return o.join(n);
849
855
  }
850
- function ge() {
856
+ function we() {
851
857
  return R.size;
852
858
  }
853
- function me() {
859
+ function Se() {
854
860
  return C.size;
855
861
  }
856
- function he() {
862
+ function xe() {
857
863
  return F.size;
858
864
  }
859
- function de() {
865
+ function $e() {
860
866
  R.clear(), C.clear(), F.clear();
861
867
  }
868
+ function ke() {
869
+ nt(), V(), X();
870
+ }
862
871
  export {
863
- T as after,
864
- gt as afterLast,
865
- se as apa,
866
- X as before,
867
- Y as beforeLast,
868
- mt as between,
869
- ht as betweenFirst,
870
- dt as camel,
871
- me as camelCacheSize,
872
- yt as charAt,
873
- xt as chopEnd,
874
- wt as chopStart,
875
- B as contains,
876
- $t as containsAll,
877
- Zt as createRandomStringsNormally,
878
- v as createRandomStringsUsing,
879
- Kt as createRandomStringsUsingSequence,
880
- At as deduplicate,
881
- kt as doesntContain,
882
- bt as doesntEndWith,
883
- ie as doesntStartWith,
884
- M as endsWith,
885
- St as excerpt,
886
- Et as finish,
887
- de as flushCache,
888
- re as headline,
889
- Ct as is,
890
- Ft as isAscii,
891
- zt as isJson,
892
- Pt as isMatch,
893
- Nt as isUrl,
894
- _t as kebab,
895
- st as lcfirst,
896
- z as length,
897
- Ot as limit,
898
- H as lower,
899
- N as makePad,
900
- Mt as mask,
901
- Ut as match,
902
- It as matchAll,
903
- qt as numbers,
904
- Gt as padBoth,
905
- Tt as padLeft,
906
- Bt as padRight,
907
- ce as pascal,
908
- Ht as password,
909
- Jt as position,
910
- j as random,
911
- te as remove,
912
- Dt as repeat,
913
- Xt as replace,
914
- Qt as replaceArray,
915
- jt as replaceEnd,
916
- tt as replaceFirst,
917
- et as replaceLast,
918
- vt as replaceMatches,
919
- Yt as replaceStart,
920
- ee as reverse,
921
- rt as snake,
922
- ge as snakeCacheSize,
923
- oe as squish,
924
- ne as start,
925
- U as startsWith,
926
- nt as stripTags,
927
- J as studly,
928
- he as studlyCacheSize,
929
- le as swap,
930
- fe as take,
931
- Vt as toStringOr,
932
- ae as ucfirst,
933
- ot as ucsplit,
934
- it as ucwords,
935
- Rt as unwrap,
936
- ue as wordCount,
937
- pe as wordWrap,
938
- Wt as words,
939
- Lt as wrap
872
+ B as after,
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,
884
+ H as contains,
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,
908
+ J as lower,
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,
938
+ K as studly,
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
940
951
  };