@tempots/std 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/string.js CHANGED
@@ -1,392 +1,206 @@
1
- import { anyElement as l, allElements as b, generateArray as A, createFilledArray as I } from "./array.js";
1
+ import { anyElement as l, allElements as b, generateArray as S, createFilledArray as O } from "./array.js";
2
+ import { MissingImplementationError as A } from "./error.js";
2
3
  import { mapRegExp as h } from "./regexp.js";
3
- function c(n, t, r) {
4
- return n.split(t).join(r);
5
- }
6
- function J(n, t) {
7
- const r = n.indexOf(t);
8
- return r < 0 ? "" : n.substring(r + t.length);
9
- }
10
- function V(n, t) {
11
- const r = n.lastIndexOf(t);
12
- return r < 0 ? "" : n.substring(r + t.length);
13
- }
14
- function X(n, t) {
15
- const r = n.indexOf(t);
16
- return r < 0 ? "" : n.substring(0, r);
17
- }
18
- function Y(n, t) {
19
- const r = n.lastIndexOf(t);
20
- return r < 0 ? "" : n.substring(0, r);
21
- }
22
- function p(n) {
23
- return n.substring(0, 1).toUpperCase() + n.substring(1);
24
- }
25
- const d = (n) => n.toUpperCase();
26
- function v(n, t = !1) {
27
- return t ? h(p(n), P, d) : h(p(n), H, d);
28
- }
29
- function nn(n) {
30
- return n.replace(Q, `
31
- `);
32
- }
33
- function tn(n, t) {
34
- return n == null && t == null ? 0 : n == null ? -1 : t == null ? 1 : E(n.toLowerCase(), t.toLowerCase());
35
- }
36
- function S(n, t) {
37
- return n.substring(0, n.length - t.length) === t;
38
- }
39
- function rn(n, t) {
40
- return n.substring(0, n.length - t.length).toLowerCase() === t.toLowerCase();
41
- }
42
- function T(n, t) {
43
- return n.substring(0, t.length) === t;
44
- }
45
- function en(n, t) {
46
- return n.substring(0, t.length).toLowerCase() === t.toLowerCase();
47
- }
48
- function on(n, t) {
49
- return W(
50
- n.toLowerCase(),
51
- t.map((r) => r.toLowerCase())
52
- );
53
- }
54
- function sn(n, t) {
55
- return _(
56
- n.toLowerCase(),
57
- t.map((r) => r.toLowerCase())
58
- );
59
- }
60
- function un(n) {
61
- return n.trim().replace(w, " ");
62
- }
63
- function E(n, t) {
64
- return n < t ? -1 : n > t ? 1 : 0;
65
- }
66
- function L(n, t) {
67
- return n.toLowerCase().includes(t.toLowerCase());
68
- }
69
- function g(n, t) {
70
- return n.includes(t);
71
- }
72
- function fn(n, t) {
73
- return n.split(t).length - 1;
74
- }
75
- function cn(n, t) {
76
- return l(t, (r) => L(n, r));
77
- }
78
- function ln(n, t) {
79
- return l(t, (r) => g(n, r));
80
- }
81
- function gn(n, t) {
82
- return b(t, (r) => L(n, r));
83
- }
84
- function an(n, t) {
85
- return b(t, (r) => g(n, r));
86
- }
87
- function hn(n) {
88
- return n.replace("_", "-");
89
- }
90
- function pn(n, t) {
91
- if (n === t) return -1;
92
- const r = Math.min(n.length, t.length);
93
- for (let e = 0; e < r; e++)
94
- if (n.substring(e, e + 1) !== t.substring(e, e + 1)) return e;
95
- return r;
96
- }
97
- function O(n, t = 20, r = "…") {
98
- const e = n.length, i = r.length;
99
- return e > t ? t < i ? r.substr(i - t, t) : n.substr(0, t - i) + r : n;
100
- }
101
- function dn(n, t = 20, r = "…") {
102
- const e = n.length, i = r.length;
103
- if (e > t) {
104
- if (t <= i)
105
- return O(n, t, r);
106
- const u = Math.ceil((t - i) / 2), f = Math.floor((t - i) / 2);
107
- return n.substr(0, u) + r + n.substr(e - f, f);
108
- } else return n;
109
- }
110
- function W(n, t) {
111
- return l(t, (r) => S(n, r));
112
- }
113
- function Cn(n, t) {
114
- return a(n).filter(t).join("");
115
- }
116
- function bn(n, t) {
117
- return F(n).filter(t).map((e) => String.fromCharCode(e)).join("");
118
- }
119
- function An(n, t = 2166136261) {
120
- let r = t;
121
- for (let e = 0, i = n.length; e < i; e++)
122
- r ^= n.charCodeAt(e), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
123
- return r >>> 0;
124
- }
125
- function Sn(n) {
126
- return n != null && n.length > 0;
127
- }
128
- function Ln(n) {
129
- return c(U(n), "_", " ");
130
- }
131
- function xn(n) {
132
- return n.length > 0 && !D.test(n);
133
- }
134
- function wn(n) {
135
- return R.test(n);
136
- }
137
- function mn(n) {
138
- return !Z.test(n);
139
- }
140
- function In(n) {
141
- return n.toLowerCase() === n;
142
- }
143
- function Tn(n) {
144
- return n.toUpperCase() === n;
145
- }
146
- function En(n, t) {
147
- return n != null && n !== "" ? n : t;
148
- }
149
- function On(n) {
150
- return G.test(n);
151
- }
152
- function Wn(n) {
153
- return n == null || n === "";
154
- }
155
- function yn(n) {
156
- return n.substring(0, 1).toLowerCase() + n.substring(1);
157
- }
158
- function y(n, t = 1) {
159
- return n.substring(
160
- Math.floor((n.length - t + 1) * Math.random()),
161
- t
162
- );
163
- }
164
- function z(n, t) {
165
- return A(t, () => y(n)).join("");
166
- }
167
- function zn(n) {
168
- return z(k, n);
169
- }
170
- function Bn(n, t) {
171
- return a(t).map(n);
172
- }
173
- function jn(n, t) {
174
- return c(n, t, "");
175
- }
176
- function _n(n, t) {
177
- return S(n, t) ? n.substring(0, n.length - t.length) : n;
178
- }
179
- function Fn(n, t, r) {
180
- return n.substring(0, t) + n.substring(t + r);
181
- }
182
- function Mn(n, t) {
183
- return T(n, t) ? n.substring(t.length) : n;
184
- }
185
- function Nn(n, t) {
186
- const r = n.indexOf(t);
187
- return r < 0 ? n : n.substring(0, r) + n.substring(r + t.length);
188
- }
189
- function x(n, t) {
190
- return I(t, n).join("");
191
- }
192
- function Un(n) {
193
- const t = a(n);
194
- return t.reverse(), t.join("");
195
- }
196
- function B(n, t = "'") {
197
- return t === "'" ? n.includes("'") ? n.includes('"') ? "'" + c(n, "'", "\\'") + "'" : '"' + n + '"' : "'" + n + "'" : n.includes('"') ? n.includes("'") ? '"' + c(n, '"', '\\"') + '"' : "'" + n + "'" : '"' + n + '"';
198
- }
199
- function j(n, t = "'") {
200
- return t + c(n, t, "\\" + t) + t;
201
- }
202
- function $n(n, t = "'") {
203
- return n.indexOf(`
204
- `) >= 0 ? j(n, "`") : B(n, t);
205
- }
206
- function kn(n, t) {
207
- const r = n.indexOf(t);
208
- return r < 0 ? [n] : [n.substring(0, r), n.substring(r + t.length)];
209
- }
210
- function _(n, t) {
211
- return l(t, (r) => n.startsWith(r));
212
- }
213
- function Hn(n, t, r = t) {
214
- return `${t}${n}${r}`;
215
- }
216
- function a(n) {
217
- return n.split("");
218
- }
219
- function F(n) {
220
- return A(n.length, (t) => n.charCodeAt(t));
221
- }
222
- function Zn(n, t) {
223
- const r = [];
224
- for (; n.length > 0; )
225
- r.push(n.substring(0, t)), n = n.substr(t, n.length - t);
226
- return r;
227
- }
228
- function Dn(n) {
229
- return n.split(m);
230
- }
231
- function Pn(n, t) {
232
- return N(M(n, t), t);
233
- }
234
- function M(n, t) {
235
- let r = 0;
236
- for (let e = 0; e < n.length && g(t, n.charAt(e)); e++)
237
- r++;
238
- return n.substring(r);
239
- }
240
- function N(n, t) {
241
- const r = n.length;
242
- let e = r, i;
243
- for (let u = 0; u < r && (i = r - u - 1, g(t, n.charAt(i))); u++)
244
- e = i;
245
- return n.substring(0, e);
246
- }
247
- function U(n) {
248
- return n = n.replace(/::/g, "/"), n = n.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), n = n.replace(/([a-z\d])([A-Z])/g, "$1_$2"), n = n.replace(/-/g, "_"), n.toLowerCase();
249
- }
250
- function Rn(n) {
251
- return n.substring(0, 1).toUpperCase() + n.substring(1);
252
- }
253
- function Gn(n, t = 78, r = "", e = `
254
- `) {
255
- return n.split(m).map(
256
- (i) => $(i.replace(w, " ").trim(), t, r, e)
257
- ).join(e);
258
- }
259
- function C(n, t) {
260
- if (t < 0 || t >= n.length) return !1;
261
- const r = n.charCodeAt(t);
262
- return r === 9 || r === 10 || r === 11 || r === 12 || r === 13 || r === 32;
263
- }
264
- function Qn(n) {
4
+ const u = (t, n, e) => t.split(n).join(e), X = (t, n) => {
5
+ const e = t.indexOf(n);
6
+ return e < 0 ? "" : t.substring(e + n.length);
7
+ }, Y = (t, n) => {
8
+ const e = t.lastIndexOf(n);
9
+ return e < 0 ? "" : t.substring(e + n.length);
10
+ }, v = (t, n) => {
11
+ const e = t.indexOf(n);
12
+ return e < 0 ? "" : t.substring(0, e);
13
+ }, tt = (t, n) => {
14
+ const e = t.lastIndexOf(n);
15
+ return e < 0 ? "" : t.substring(0, e);
16
+ }, p = (t) => t.substring(0, 1).toUpperCase() + t.substring(1), d = (t) => t.toUpperCase(), nt = (t, n = !1) => n ? h(p(t), F, d) : h(p(t), D, d), et = (t) => t.replace(K, `
17
+ `), rt = (t, n) => t == null && n == null ? 0 : t == null ? -1 : n == null ? 1 : W(t.toLowerCase(), n.toLowerCase()), L = (t, n) => t.substring(0, t.length - n.length) === n, st = (t, n) => t.substring(0, t.length - n.length).toLowerCase() === n.toLowerCase(), x = (t, n) => t.substring(0, n.length) === n, it = (t, n) => t.substring(0, n.length).toLowerCase() === n.toLowerCase(), ot = (t, n) => B(
18
+ t.toLowerCase(),
19
+ n.map((e) => e.toLowerCase())
20
+ ), ct = (t, n) => M(
21
+ t.toLowerCase(),
22
+ n.map((e) => e.toLowerCase())
23
+ ), ut = (t) => t.trim().replace(m, " "), W = (t, n) => t < n ? -1 : t > n ? 1 : 0, w = (t, n) => t.toLowerCase().includes(n.toLowerCase()), a = (t, n) => t.includes(n), gt = (t, n) => t.split(n).length - 1, lt = (t, n) => l(n, (e) => w(t, e)), at = (t, n) => l(n, (e) => a(t, e)), ft = (t, n) => b(n, (e) => w(t, e)), ht = (t, n) => b(n, (e) => a(t, e)), pt = (t) => t.replace("_", "-"), dt = (t, n) => {
24
+ if (t === n) return -1;
25
+ const e = Math.min(t.length, n.length);
26
+ for (let r = 0; r < e; r++)
27
+ if (t.substring(r, r + 1) !== n.substring(r, r + 1)) return r;
28
+ return e;
29
+ }, y = (t, n = 20, e = "…") => {
30
+ const r = t.length, s = e.length;
31
+ return r > n ? n < s ? e.slice(s - n, n) : t.slice(0, n - s) + e : t;
32
+ }, Ct = (t, n = 20, e = "…") => {
33
+ const r = t.length, s = e.length;
34
+ if (r > n) {
35
+ if (n <= s)
36
+ return y(t, n, e);
37
+ const c = Math.ceil((n - s) / 2), g = Math.floor((n - s) / 2);
38
+ return t.slice(0, c) + e + t.slice(r - g);
39
+ } else return t;
40
+ }, B = (t, n) => l(n, (e) => L(t, e)), bt = (t, n) => f(t).filter(n).join(""), St = (t, n) => _(t).filter(n).map((r) => String.fromCharCode(r)).join(""), At = (t, n = 2166136261) => {
41
+ let e = n;
42
+ for (let r = 0, s = t.length; r < s; r++)
43
+ e ^= t.charCodeAt(r), e += (e << 1) + (e << 4) + (e << 7) + (e << 8) + (e << 24);
44
+ return e >>> 0;
45
+ }, Lt = (t) => t != null && t.length > 0, wt = (t) => u(k(t), "_", " "), It = (t) => t.length > 0 && !R.test(t), mt = (t) => G.test(t), Et = (t) => !P.test(t), Ot = (t) => t.toLowerCase() === t, xt = (t) => t.toUpperCase() === t, Wt = (t, n) => t != null && t !== "" ? t : n, yt = (t) => Q.test(t), Bt = (t) => t == null || t === "", zt = (t) => t.substring(0, 1).toLowerCase() + t.substring(1), z = (t, n = 1) => t.substring(
46
+ Math.floor((t.length - n + 1) * Math.random()),
47
+ n
48
+ ), T = (t, n) => S(n, () => z(t)).join(""), Tt = (t) => T(Z, t), jt = (t, n) => f(n).map(t), Nt = (t, n) => u(t, n, ""), Mt = (t, n) => L(t, n) ? t.substring(0, t.length - n.length) : t, _t = (t, n, e) => t.substring(0, n) + t.substring(n + e), Ut = (t, n) => x(t, n) ? t.substring(n.length) : t, $t = (t, n) => {
49
+ const e = t.indexOf(n);
50
+ return e < 0 ? t : t.substring(0, e) + t.substring(e + n.length);
51
+ }, I = (t, n) => O(n, t).join(""), kt = (t) => {
52
+ const n = f(t);
53
+ return n.reverse(), n.join("");
54
+ }, j = (t, n = "'") => n === "'" ? t.includes("'") ? t.includes('"') ? "'" + u(t, "'", "\\'") + "'" : '"' + t + '"' : "'" + t + "'" : t.includes('"') ? t.includes("'") ? '"' + u(t, '"', '\\"') + '"' : "'" + t + "'" : '"' + t + '"', N = (t, n = "'") => n + u(t, n, "\\" + n) + n, Ht = (t, n = "'") => t.indexOf(`
55
+ `) >= 0 ? N(t, "`") : j(t, n), Zt = (t, n) => {
56
+ const e = t.indexOf(n);
57
+ return e < 0 ? [t] : [t.substring(0, e), t.substring(e + n.length)];
58
+ }, M = (t, n) => l(n, (e) => t.startsWith(e)), Dt = (t, n, e = n) => `${n}${t}${e}`, f = (t) => t.split(""), _ = (t) => S(t.length, (n) => t.charCodeAt(n)), Pt = (t, n) => {
59
+ const e = [];
60
+ for (; t.length > 0; )
61
+ e.push(t.substring(0, n)), t = t.substring(n, t.length - n);
62
+ return e;
63
+ }, Rt = (t) => t.split(E), Ft = (t, n) => $(U(t, n), n), U = (t, n) => {
64
+ let e = 0;
65
+ for (let r = 0; r < t.length && a(n, t.charAt(r)); r++)
66
+ e++;
67
+ return t.substring(e);
68
+ }, $ = (t, n) => {
69
+ const e = t.length;
70
+ let r = e, s;
71
+ for (let c = 0; c < e && (s = e - c - 1, a(n, t.charAt(s))); c++)
72
+ r = s;
73
+ return t.substring(0, r);
74
+ }, k = (t) => (t = t.replace(/::/g, "/"), t = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), t = t.replace(/([a-z\d])([A-Z])/g, "$1_$2"), t = t.replace(/-/g, "_"), t.toLowerCase()), Gt = (t) => t.substring(0, 1).toUpperCase() + t.substring(1), Qt = (t, n = 78, e = "", r = `
75
+ `) => t.split(E).map(
76
+ (s) => H(s.replace(m, " ").trim(), n, e, r)
77
+ ).join(r), C = (t, n) => {
78
+ if (n < 0 || n >= t.length) return !1;
79
+ const e = t.charCodeAt(n);
80
+ return e === 9 || e === 10 || e === 11 || e === 12 || e === 13 || e === 32;
81
+ }, Kt = (t) => {
265
82
  if (typeof Buffer < "u")
266
- return Buffer.from(n).toString("base64");
83
+ return Buffer.from(t).toString("base64");
267
84
  if (typeof btoa < "u")
268
- return btoa(n);
269
- throw new Error("no implementation found for base64 encoding");
270
- }
271
- function Kn(n) {
85
+ return btoa(t);
86
+ throw new A(
87
+ "No implementation found for base64 encoding"
88
+ );
89
+ }, qt = (t) => {
272
90
  if (typeof Buffer < "u")
273
- return Buffer.from(n, "base64").toString("utf8");
91
+ return Buffer.from(t, "base64").toString("utf8");
274
92
  if (typeof atob < "u")
275
- return atob(n);
276
- throw new Error("no implementation found for base64 decoding");
277
- }
278
- function $(n, t, r, e) {
279
- const i = [], u = n.length, f = r.length;
280
- let s = 0;
281
- for (t -= f; ; ) {
282
- if (s + t >= u - f) {
283
- i.push(n.substring(s));
93
+ return atob(t);
94
+ throw new A(
95
+ "No implementation found for base64 decoding"
96
+ );
97
+ }, H = (t, n, e, r) => {
98
+ const s = [], c = t.length, g = e.length;
99
+ let o = 0;
100
+ for (n -= g; ; ) {
101
+ if (o + n >= c - g) {
102
+ s.push(t.substring(o));
284
103
  break;
285
104
  }
286
- let o = 0;
287
- for (; !C(n, s + t - o) && o < t; ) o++;
288
- if (o === t) {
289
- for (o = 0; !C(n, s + t + o) && s + t + o < u; ) o++;
290
- i.push(n.substring(s, s + t + o)), s += t + o + 1;
105
+ let i = 0;
106
+ for (; !C(t, o + n - i) && i < n; ) i++;
107
+ if (i === n) {
108
+ for (i = 0; !C(t, o + n + i) && o + n + i < c; ) i++;
109
+ s.push(t.substring(o, o + n + i)), o += n + i + 1;
291
110
  } else
292
- i.push(n.substring(s, s + t - o)), s += t - o + 1;
111
+ s.push(t.substring(o, o + n - i)), o += n - i + 1;
293
112
  }
294
- return r + i.join(e + r);
295
- }
296
- function qn(n, t, r) {
297
- const e = r - n.length;
298
- return e > 0 ? x(t, e) + n : n;
299
- }
300
- function Jn(n, t, r) {
301
- const e = r - n.length;
302
- return e > 0 ? n + x(t, e) : n;
303
- }
304
- function Vn(n, t) {
305
- const r = n.lastIndexOf(t);
306
- return r >= 0 ? [n.substring(0, r), n.substring(r + t.length)] : [n];
307
- }
308
- function Xn(n, t) {
309
- const r = n.indexOf(t);
310
- return r >= 0 ? [n.substring(0, r), n.substring(r + t.length)] : [n];
311
- }
312
- const k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", H = /[^a-zA-Z]([a-z])/g, Z = /[^\t\n\r ]/, D = /[^a-zA-Z]/, P = /[ \t\r\n][a-z]/g, R = /^[a-z0-9]+$/i, G = /^[0-9]+$/, w = /[ \t\r\n]+/g, m = /\r\n|\n\r|\n|\r/g, Q = /\r\n|\n\r|\r/g;
113
+ return e + s.join(r + e);
114
+ }, Jt = (t, n, e) => {
115
+ const r = e - t.length;
116
+ return r > 0 ? I(n, r) + t : t;
117
+ }, Vt = (t, n, e) => {
118
+ const r = e - t.length;
119
+ return r > 0 ? t + I(n, r) : t;
120
+ }, Xt = (t, n) => {
121
+ const e = t.lastIndexOf(n);
122
+ return e >= 0 ? [t.substring(0, e), t.substring(e + n.length)] : [t];
123
+ }, Yt = (t, n) => {
124
+ const e = t.indexOf(n);
125
+ return e >= 0 ? [t.substring(0, e), t.substring(e + n.length)] : [t];
126
+ }, Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", D = /[^a-zA-Z]([a-z])/g, P = /[^\t\n\r ]/, R = /[^a-zA-Z]/, F = /[ \t\r\n][a-z]/g, G = /^[a-z0-9]+$/i, Q = /^[0-9]+$/, m = /[ \t\r\n]+/g, E = /\r\n|\n\r|\n|\r/g, K = /\r\n|\n\r|\r/g;
313
127
  export {
314
- V as afterLastText,
315
- J as afterText,
316
- Y as beforeLastText,
317
- X as beforeText,
318
- nn as canonicalizeNewlines,
128
+ et as canonicalizeNewlines,
319
129
  p as capitalize,
320
- v as capitalizeWords,
321
- Zn as chunkText,
322
- tn as compareCaseInsensitive,
323
- E as compareStrings,
324
- an as containsAllText,
325
- gn as containsAllTextCaseInsensitive,
326
- ln as containsAnyText,
327
- cn as containsAnyTextCaseInsensitive,
328
- fn as countTextOccurrences,
329
- hn as dasherize,
330
- Kn as decodeBase64,
331
- O as ellipsis,
332
- dn as ellipsisMiddle,
333
- Qn as encodeBase64,
334
- W as endsWithAnyText,
335
- bn as filterCharcode,
336
- Cn as filterText,
337
- Ln as humanize,
338
- En as ifEmptyString,
339
- xn as isAlpha,
340
- wn as isAlphaNum,
341
- mn as isBreakingWhitespace,
342
- On as isDigitsOnly,
343
- Wn as isEmptyString,
344
- In as isLowerCase,
130
+ nt as capitalizeWords,
131
+ Pt as chunkString,
132
+ ut as collapseText,
133
+ rt as compareCaseInsensitive,
134
+ W as compareStrings,
135
+ ht as containsAllText,
136
+ ft as containsAllTextCaseInsensitive,
137
+ at as containsAnyText,
138
+ lt as containsAnyTextCaseInsensitive,
139
+ gt as countStringOccurrences,
140
+ pt as dasherize,
141
+ qt as decodeBase64,
142
+ $t as deleteFirstFromString,
143
+ Mt as deleteStringAfter,
144
+ Ut as deleteStringBefore,
145
+ Nt as deleteSubstring,
146
+ y as ellipsis,
147
+ Ct as ellipsisMiddle,
148
+ Kt as encodeBase64,
149
+ St as filterCharcodes,
150
+ bt as filterChars,
151
+ wt as humanize,
152
+ Wt as ifEmptyString,
153
+ It as isAlpha,
154
+ mt as isAlphaNum,
155
+ Et as isBreakingWhitespace,
156
+ yt as isDigitsOnly,
157
+ Bt as isEmptyString,
158
+ Ot as isLowerCase,
345
159
  C as isSpaceAt,
346
- Tn as isUpperCase,
347
- $n as jsQuote,
348
- yn as lowerCaseFirst,
349
- qn as lpad,
350
- Bn as mapChars,
351
- j as quote,
352
- y as randomString,
353
- z as randomStringSequence,
354
- zn as randomStringSequenceBase64,
355
- Nn as removeFirstFromString,
356
- jn as removeFromString,
357
- _n as removeFromStringAfter,
358
- Mn as removeFromStringBefore,
359
- Fn as removeSliceFromString,
360
- x as repeatString,
361
- c as replaceAll,
362
- Un as reverseString,
363
- Jn as rpad,
364
- B as smartQuote,
365
- Xn as splitOnFirst,
366
- Vn as splitOnLast,
367
- kn as splitStringOnce,
368
- Sn as stringHasContent,
369
- An as stringHashCode,
370
- F as stringToCharcodes,
371
- a as stringToChars,
372
- Dn as stringToLines,
373
- pn as stringsDifferAtIndex,
374
- Hn as surroundText,
375
- un as textCollapse,
376
- g as textContains,
377
- L as textContainsCaseInsensitive,
378
- S as textEndsWith,
379
- on as textEndsWithAnyCaseInsensitive,
380
- rn as textEndsWithCaseInsensitive,
381
- T as textStartsWith,
382
- _ as textStartsWithAny,
383
- sn as textStartsWithAnyCaseInsensitive,
384
- en as textStartsWithCaseInsensitive,
385
- Pn as trimChars,
386
- M as trimCharsLeft,
387
- N as trimCharsRight,
388
- U as underscore,
389
- Rn as upperCaseFirst,
390
- Gn as wrapColumns,
391
- $ as wrapLine
160
+ xt as isUpperCase,
161
+ Ht as jsQuote,
162
+ zt as lowerCaseFirst,
163
+ Jt as lpad,
164
+ jt as mapChars,
165
+ N as quote,
166
+ z as randomString,
167
+ T as randomStringSequence,
168
+ Tt as randomStringSequenceBase64,
169
+ I as repeatString,
170
+ u as replaceAll,
171
+ kt as reverseString,
172
+ Vt as rpad,
173
+ j as smartQuote,
174
+ Yt as splitStringOnFirst,
175
+ Xt as splitStringOnLast,
176
+ Zt as splitStringOnce,
177
+ a as stringContains,
178
+ L as stringEndsWith,
179
+ B as stringEndsWithAny,
180
+ Lt as stringHasContent,
181
+ At as stringHashCode,
182
+ x as stringStartsWith,
183
+ M as stringStartsWithAny,
184
+ _ as stringToCharcodes,
185
+ f as stringToChars,
186
+ dt as stringsDifferAtIndex,
187
+ X as substringAfter,
188
+ Y as substringAfterLast,
189
+ v as substringBefore,
190
+ tt as substringBeforeLast,
191
+ Dt as surroundString,
192
+ w as textContainsCaseInsensitive,
193
+ ot as textEndsWithAnyCaseInsensitive,
194
+ st as textEndsWithCaseInsensitive,
195
+ ct as textStartsWithAnyCaseInsensitive,
196
+ it as textStartsWithCaseInsensitive,
197
+ Rt as textToLines,
198
+ Ft as trimChars,
199
+ U as trimCharsLeft,
200
+ $ as trimCharsRight,
201
+ _t as trimStringSlice,
202
+ k as underscore,
203
+ Gt as upperCaseFirst,
204
+ Qt as wrapColumns,
205
+ H as wrapLine
392
206
  };
package/validation.d.ts CHANGED
@@ -4,18 +4,18 @@ import { Result } from './result';
4
4
  * Represents a valid result.
5
5
  * @public
6
6
  */
7
- export interface Valid {
8
- type: 'valid';
9
- }
7
+ export type Valid = {
8
+ readonly type: 'valid';
9
+ };
10
10
  /**
11
11
  * Represents an invalid value with an associated error.
12
12
  * @typeParam E - The type of the error.
13
13
  * @public
14
14
  */
15
- export interface Invalid<E> {
16
- type: 'invalid';
17
- error: E;
18
- }
15
+ export type Invalid<E> = {
16
+ readonly type: 'invalid';
17
+ readonly error: E;
18
+ };
19
19
  /**
20
20
  * Represents a type that can either be `Valid` or `Invalid`.
21
21
  * @typeParam E - The type of the error associated with an `Invalid` value.