@tempots/std 0.12.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,402 +1,206 @@
1
- import { anyElement as l, allElements as C, generateArray as A, createFilledArray as S } 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), H, d) : h(p(n), R, 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 : y(n.toLowerCase(), t.toLowerCase());
35
- }
36
- function L(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 W(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 z(
50
- n.toLowerCase(),
51
- t.map((r) => r.toLowerCase())
52
- );
53
- }
54
- function un(n, t) {
55
- return N(
56
- n.toLowerCase(),
57
- t.map((r) => r.toLowerCase())
58
- );
59
- }
60
- function sn(n) {
61
- return n.trim().replace(m, " ");
62
- }
63
- function y(n, t) {
64
- return n < t ? -1 : n > t ? 1 : 0;
65
- }
66
- function w(n, t) {
67
- return n.toLowerCase().includes(t.toLowerCase());
68
- }
69
- function a(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) => w(n, r));
77
- }
78
- function ln(n, t) {
79
- return l(t, (r) => a(n, r));
80
- }
81
- function an(n, t) {
82
- return C(t, (r) => w(n, r));
83
- }
84
- function gn(n, t) {
85
- return C(t, (r) => a(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 E(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 E(n, t, r);
106
- const s = Math.ceil((t - i) / 2), f = Math.floor((t - i) / 2);
107
- return n.substr(0, s) + r + n.substr(e - f, f);
108
- } else return n;
109
- }
110
- function z(n, t) {
111
- return l(t, (r) => L(n, r));
112
- }
113
- function bn(n, t) {
114
- return g(n).filter(t).join("");
115
- }
116
- function Cn(n, t) {
117
- return U(n).filter(t).map((e) => String.fromCharCode(e)).join("");
118
- }
119
- function An(n, t) {
120
- const r = n.indexOf(t);
121
- return r < 0 ? "" : n.substring(r);
122
- }
123
- function Ln(n, t = 2166136261) {
124
- let r = t;
125
- for (let e = 0, i = n.length; e < i; e++)
126
- r ^= n.charCodeAt(e), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
127
- return r >>> 0;
128
- }
129
- function wn(n) {
130
- return n != null && n.length > 0;
131
- }
132
- function In(n) {
133
- return c(k(n), "_", " ");
134
- }
135
- function mn(n) {
136
- return n.length > 0 && !D.test(n);
137
- }
138
- function On(n) {
139
- return G.test(n);
140
- }
141
- function Sn(n) {
142
- return !T.test(n);
143
- }
144
- function Wn(n) {
145
- return n.toLowerCase() === n;
146
- }
147
- function yn(n) {
148
- return n.toUpperCase() === n;
149
- }
150
- function En(n, t) {
151
- return n != null && n !== "" ? n : t;
152
- }
153
- function zn(n) {
154
- return F.test(n);
155
- }
156
- function Bn(n) {
157
- return n == null || n === "";
158
- }
159
- function jn(n) {
160
- return n.substring(0, 1).toLowerCase() + n.substring(1);
161
- }
162
- function B(n, t = 1) {
163
- return n.substring(
164
- Math.floor((n.length - t + 1) * Math.random()),
165
- t
166
- );
167
- }
168
- function j(n, t) {
169
- return A(t, () => B(n)).join("");
170
- }
171
- function _n(n) {
172
- return j(P, n);
173
- }
174
- function Mn(n, t) {
175
- return g(t).map(n);
176
- }
177
- function Nn(n, t) {
178
- return c(n, t, "");
179
- }
180
- function Un(n, t) {
181
- return L(n, t) ? n.substring(0, n.length - t.length) : n;
182
- }
183
- function $n(n, t, r) {
184
- return n.substring(0, t) + n.substring(t + r);
185
- }
186
- function xn(n, t) {
187
- return W(n, t) ? n.substring(t.length) : n;
188
- }
189
- function kn(n, t) {
190
- const r = n.indexOf(t);
191
- return r < 0 ? n : n.substring(0, r) + n.substring(r + t.length);
192
- }
193
- function I(n, t) {
194
- return S(t, n).join("");
195
- }
196
- function Zn(n) {
197
- const t = g(n);
198
- return t.reverse(), t.join("");
199
- }
200
- function _(n, t = "'") {
201
- return t === "'" ? n.includes("'") ? n.includes('"') ? "'" + c(n, "'", "\\'") + "'" : '"' + n + '"' : "'" + n + "'" : n.includes('"') ? n.includes("'") ? '"' + c(n, '"', '\\"') + '"' : "'" + n + "'" : '"' + n + '"';
202
- }
203
- function M(n, t = "'") {
204
- return t + c(n, t, "\\" + t) + t;
205
- }
206
- function Pn(n, t = "'") {
207
- return n.indexOf(`
208
- `) >= 0 ? M(n, "`") : _(n, t);
209
- }
210
- function Rn(n, t) {
211
- const r = n.indexOf(t);
212
- return r < 0 ? [n] : [n.substring(0, r), n.substring(r + t.length)];
213
- }
214
- function N(n, t) {
215
- return l(t, (r) => n.startsWith(r));
216
- }
217
- function Tn(n, t, r = t) {
218
- return `${t}${n}${r}`;
219
- }
220
- function g(n) {
221
- return n.split("");
222
- }
223
- function U(n) {
224
- return A(n.length, (t) => n.charCodeAt(t));
225
- }
226
- function Dn(n, t) {
227
- const r = [];
228
- for (; n.length > 0; )
229
- r.push(n.substring(0, t)), n = n.substr(t, n.length - t);
230
- return r;
231
- }
232
- function Hn(n) {
233
- return n.split(O);
234
- }
235
- function Gn(n, t) {
236
- return x($(n, t), t);
237
- }
238
- function $(n, t) {
239
- let r = 0;
240
- for (let e = 0; e < n.length && a(t, n.charAt(e)); e++)
241
- r++;
242
- return n.substring(r);
243
- }
244
- function x(n, t) {
245
- const r = n.length;
246
- let e = r, i;
247
- for (let s = 0; s < r && (i = r - s - 1, a(t, n.charAt(i))); s++)
248
- e = i;
249
- return n.substring(0, e);
250
- }
251
- function k(n) {
252
- 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();
253
- }
254
- function Fn(n) {
255
- return n.substring(0, 1).toUpperCase() + n.substring(1);
256
- }
257
- function Qn(n, t) {
258
- const r = n.indexOf(t);
259
- return r < 0 ? n : n.substring(0, r);
260
- }
261
- function Kn(n, t = 78, r = "", e = `
262
- `) {
263
- return n.split(O).map(
264
- (i) => Z(i.replace(m, " ").trim(), t, r, e)
265
- ).join(e);
266
- }
267
- function b(n, t) {
268
- if (t < 0 || t >= n.length) return !1;
269
- const r = n.charCodeAt(t);
270
- return r === 9 || r === 10 || r === 11 || r === 12 || r === 13 || r === 32;
271
- }
272
- 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) => {
273
82
  if (typeof Buffer < "u")
274
- return Buffer.from(n).toString("base64");
83
+ return Buffer.from(t).toString("base64");
275
84
  if (typeof btoa < "u")
276
- return btoa(n);
277
- throw new Error("no implementation found for base64 encoding");
278
- }
279
- function Jn(n) {
85
+ return btoa(t);
86
+ throw new A(
87
+ "No implementation found for base64 encoding"
88
+ );
89
+ }, qt = (t) => {
280
90
  if (typeof Buffer < "u")
281
- return Buffer.from(n, "base64").toString("utf8");
91
+ return Buffer.from(t, "base64").toString("utf8");
282
92
  if (typeof atob < "u")
283
- return atob(n);
284
- throw new Error("no implementation found for base64 decoding");
285
- }
286
- function Z(n, t, r, e) {
287
- const i = [], s = n.length, f = r.length;
288
- let u = 0;
289
- for (t -= f; ; ) {
290
- if (u + t >= s - f) {
291
- i.push(n.substring(u));
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));
292
103
  break;
293
104
  }
294
- let o = 0;
295
- for (; !b(n, u + t - o) && o < t; ) o++;
296
- if (o === t) {
297
- for (o = 0; !b(n, u + t + o) && u + t + o < s; ) o++;
298
- i.push(n.substring(u, u + t + o)), u += 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;
299
110
  } else
300
- i.push(n.substring(u, u + t - o)), u += t - o + 1;
111
+ s.push(t.substring(o, o + n - i)), o += n - i + 1;
301
112
  }
302
- return r + i.join(e + r);
303
- }
304
- function Vn(n, t, r) {
305
- const e = r - n.length;
306
- return e > 0 ? I(t, e) + n : n;
307
- }
308
- function Xn(n, t, r) {
309
- const e = r - n.length;
310
- return e > 0 ? n + I(t, e) : n;
311
- }
312
- function Yn(n, t) {
313
- const r = n.lastIndexOf(t);
314
- return r >= 0 ? [n.substring(0, r), n.substring(r + t.length)] : [n];
315
- }
316
- function vn(n, t) {
317
- const r = n.indexOf(t);
318
- return r >= 0 ? [n.substring(0, r), n.substring(r + t.length)] : [n];
319
- }
320
- const P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", R = /[^a-zA-Z]([a-z])/g, T = /[^\t\n\r ]/, D = /[^a-zA-Z]/, H = /[ \t\r\n][a-z]/g, G = /^[a-z0-9]+$/i, F = /^[0-9]+$/, m = /[ \t\r\n]+/g, O = /\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;
321
127
  export {
322
- J as after,
323
- V as afterLast,
324
- X as before,
325
- Y as beforeLast,
326
- nn as canonicalizeNewlines,
128
+ et as canonicalizeNewlines,
327
129
  p as capitalize,
328
- v as capitalizeWords,
329
- sn as collapse,
330
- tn as compareCaseInsensitive,
331
- y as compareStrings,
332
- a as contains,
333
- gn as containsAll,
334
- an as containsAllCaseInsensitive,
335
- ln as containsAny,
336
- cn as containsAnyCaseInsensitive,
337
- w as containsCaseInsensitive,
338
- fn as count,
339
- hn as dasherize,
340
- Jn as decodeBase64,
341
- pn as diffIndex,
342
- E as ellipsis,
343
- dn as ellipsisMiddle,
344
- qn as encodeBase64,
345
- L as endsWith,
346
- z as endsWithAny,
347
- on as endsWithAnyCaseInsensitive,
348
- rn as endsWithCaseInsensitive,
349
- bn as filter,
350
- Cn as filterCharcode,
351
- An as from,
352
- wn as hasContent,
353
- Ln as hashCode,
354
- In as humanize,
355
- En as ifEmpty,
356
- mn as isAlpha,
357
- On as isAlphaNum,
358
- Sn as isBreakingWhitespace,
359
- zn as isDigitsOnly,
360
- Bn as isEmpty,
361
- Wn as isLowerCase,
362
- b as isSpaceAt,
363
- yn as isUpperCase,
364
- Pn as jsQuote,
365
- jn as lowerCaseFirst,
366
- Vn as lpad,
367
- Mn as map,
368
- M as quote,
369
- B as random,
370
- j as randomSequence,
371
- _n as randomSequence64,
372
- Nn as remove,
373
- Un as removeAfter,
374
- $n as removeAt,
375
- xn as removeBefore,
376
- kn as removeOne,
377
- I as repeat,
378
- c as replace,
379
- Zn as reverse,
380
- Xn as rpad,
381
- _ as smartQuote,
382
- vn as splitOnFirst,
383
- Yn as splitOnLast,
384
- Rn as splitOnce,
385
- W as startsWith,
386
- N as startsWithAny,
387
- un as startsWithAnyCaseInsensitive,
388
- en as startsWithCaseInsensitive,
389
- Tn as surround,
390
- g as toArray,
391
- U as toCharcodes,
392
- Dn as toChunks,
393
- Hn as toLines,
394
- Gn as trimChars,
395
- $ as trimCharsLeft,
396
- x as trimCharsRight,
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,
159
+ C as isSpaceAt,
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,
397
202
  k as underscore,
398
- Qn as upTo,
399
- Fn as upperCaseFirst,
400
- Kn as wrapColumns,
401
- Z as wrapLine
203
+ Gt as upperCaseFirst,
204
+ Qt as wrapColumns,
205
+ H as wrapLine
402
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.