@tempots/std 0.13.0 → 0.15.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/array.cjs +1 -1
- package/array.d.ts +35 -35
- package/array.js +109 -168
- package/async-result.cjs +1 -1
- package/async-result.d.ts +38 -15
- package/async-result.js +40 -5
- package/bigint.cjs +1 -1
- package/bigint.d.ts +20 -20
- package/bigint.js +37 -78
- package/boolean.cjs +1 -1
- package/boolean.d.ts +5 -5
- package/boolean.js +10 -19
- package/equal.cjs +1 -1
- package/equal.d.ts +3 -3
- package/equal.js +31 -37
- package/error.cjs +1 -0
- package/error.d.ts +24 -0
- package/error.js +26 -0
- package/function.cjs +1 -1
- package/function.d.ts +3 -3
- package/function.js +4 -10
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.js +120 -118
- package/number.cjs +1 -1
- package/number.d.ts +25 -46
- package/number.js +29 -86
- package/object.cjs +1 -1
- package/object.d.ts +6 -6
- package/object.js +12 -27
- package/package.json +15 -1
- package/promise.cjs +1 -0
- package/promise.d.ts +11 -0
- package/promise.js +9 -0
- package/regexp.cjs +1 -1
- package/regexp.d.ts +1 -1
- package/regexp.js +8 -8
- package/{result-Czm7RKNP.js → result-CGd0jCdl.js} +54 -19
- package/result-CdwVhaAc.cjs +1 -0
- package/result.cjs +1 -1
- package/result.d.ts +31 -8
- package/result.js +1 -1
- package/string.cjs +4 -4
- package/string.d.ts +85 -89
- package/string.js +193 -379
- package/validation.cjs +1 -1
- package/validation.d.ts +7 -7
- package/validation.js +1 -1
- package/result-DzdZiQoR.cjs +0 -1
package/regexp.d.ts
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* @param subject - The string to search.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare const mapRegExp: (subject: string, pattern: RegExp, f: (...s: string[]) => string) => string;
|
package/regexp.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const h = (n, i, u) => {
|
|
2
2
|
const e = [];
|
|
3
|
-
let
|
|
3
|
+
let s = 0, l;
|
|
4
4
|
if (i.global)
|
|
5
|
-
for (i.lastIndex = 0; (l = i.exec(
|
|
6
|
-
e.push(
|
|
5
|
+
for (i.lastIndex = 0; (l = i.exec(n)) !== null; )
|
|
6
|
+
e.push(n.substring(s, l.index)), e.push(u(...l)), s = l.index + l[0].length;
|
|
7
7
|
else
|
|
8
|
-
for (; (l = i.exec(
|
|
9
|
-
e.push(
|
|
10
|
-
return e.push(
|
|
11
|
-
}
|
|
8
|
+
for (; (l = i.exec(n.substring(s))) !== null; )
|
|
9
|
+
e.push(n.substring(s, s + l.index)), e.push(u(...l)), s += l.index + l[0].length;
|
|
10
|
+
return e.push(n.substring(s)), e.join("");
|
|
11
|
+
};
|
|
12
12
|
export {
|
|
13
13
|
h as mapRegExp
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsyncResult as
|
|
2
|
-
const
|
|
1
|
+
import { AsyncResult as c } from "./async-result.js";
|
|
2
|
+
const a = {
|
|
3
3
|
/**
|
|
4
4
|
* Creates a valid `Validation`.
|
|
5
5
|
* @returns A `Validation` that is `Valid`.
|
|
@@ -37,14 +37,14 @@ const t = {
|
|
|
37
37
|
* @param invalid - The mapping function for an invalid value.
|
|
38
38
|
* @returns The mapped value.
|
|
39
39
|
*/
|
|
40
|
-
match: (e, s, r) =>
|
|
40
|
+
match: (e, s, r) => a.isValid(e) ? s() : r(e.error),
|
|
41
41
|
/**
|
|
42
42
|
* Maps the value of a `Validation` to a new `Validation`.
|
|
43
43
|
* @param validation - The `Validation` to map.
|
|
44
44
|
* @param value - The value to map.
|
|
45
45
|
* @returns A new `Validation` with the mapped value.
|
|
46
46
|
*/
|
|
47
|
-
toResult: (e, s) =>
|
|
47
|
+
toResult: (e, s) => a.match(
|
|
48
48
|
e,
|
|
49
49
|
() => u.success(s),
|
|
50
50
|
(r) => u.failure(r)
|
|
@@ -56,7 +56,7 @@ const t = {
|
|
|
56
56
|
* @param apply - The function to execute when the `Validation` is valid.
|
|
57
57
|
* @returns The `Validation` object.
|
|
58
58
|
*/
|
|
59
|
-
whenValid: (e, s) => (
|
|
59
|
+
whenValid: (e, s) => (a.isValid(e) && s(), e),
|
|
60
60
|
/**
|
|
61
61
|
* Execute a function when the `Validation` is invalid.
|
|
62
62
|
*
|
|
@@ -64,7 +64,7 @@ const t = {
|
|
|
64
64
|
* @param apply - The function to execute when the `Validation` is invalid.
|
|
65
65
|
* @returns The `Validation` object.
|
|
66
66
|
*/
|
|
67
|
-
whenInvalid: (e, s) => (
|
|
67
|
+
whenInvalid: (e, s) => (a.isInvalid(e) && s(e.error), e)
|
|
68
68
|
}, u = {
|
|
69
69
|
/**
|
|
70
70
|
* Creates a successful `Result`.
|
|
@@ -111,8 +111,8 @@ const t = {
|
|
|
111
111
|
toAsync(e) {
|
|
112
112
|
return u.match(
|
|
113
113
|
e,
|
|
114
|
-
(s) =>
|
|
115
|
-
(s) =>
|
|
114
|
+
(s) => c.success(s),
|
|
115
|
+
(s) => c.failure(s)
|
|
116
116
|
);
|
|
117
117
|
},
|
|
118
118
|
/**
|
|
@@ -124,8 +124,8 @@ const t = {
|
|
|
124
124
|
toValidation(e) {
|
|
125
125
|
return u.match(
|
|
126
126
|
e,
|
|
127
|
-
() =>
|
|
128
|
-
(s) =>
|
|
127
|
+
() => a.valid,
|
|
128
|
+
(s) => a.invalid(s)
|
|
129
129
|
);
|
|
130
130
|
},
|
|
131
131
|
/**
|
|
@@ -184,6 +184,16 @@ const t = {
|
|
|
184
184
|
getOrUndefined(e) {
|
|
185
185
|
return u.isSuccess(e) ? e.value : void 0;
|
|
186
186
|
},
|
|
187
|
+
/**
|
|
188
|
+
* Gets the value of a `Result` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
189
|
+
* @param r - The `Result` to get the value from.
|
|
190
|
+
* @returns The value of the `Result` if it is a `Success`.
|
|
191
|
+
*/
|
|
192
|
+
getUnsafe: (e) => {
|
|
193
|
+
if (u.isSuccess(e))
|
|
194
|
+
return e.value;
|
|
195
|
+
throw e.error;
|
|
196
|
+
},
|
|
187
197
|
/**
|
|
188
198
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
189
199
|
* @param success - The function to call if the result is a success.
|
|
@@ -209,22 +219,47 @@ const t = {
|
|
|
209
219
|
* @returns The combined result.
|
|
210
220
|
* @public
|
|
211
221
|
*/
|
|
212
|
-
combine: (e, s, r,
|
|
222
|
+
combine: (e, s, r, i) => u.match(
|
|
213
223
|
e,
|
|
214
|
-
(
|
|
224
|
+
(t) => u.match(
|
|
215
225
|
s,
|
|
216
|
-
(
|
|
217
|
-
(
|
|
226
|
+
(l) => u.success(r(t, l)),
|
|
227
|
+
(l) => u.failure(l)
|
|
218
228
|
),
|
|
219
|
-
(
|
|
229
|
+
(t) => u.match(
|
|
220
230
|
s,
|
|
221
231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
222
|
-
(
|
|
223
|
-
(
|
|
232
|
+
(l) => u.failure(t),
|
|
233
|
+
(l) => u.failure(i(t, l))
|
|
224
234
|
)
|
|
225
|
-
)
|
|
235
|
+
),
|
|
236
|
+
/**
|
|
237
|
+
* Compares two results for equality.
|
|
238
|
+
* @param r1 - The first result.
|
|
239
|
+
* @param r2 - The second result.
|
|
240
|
+
* @param options - The options to use for comparison. By default, uses strict equality.
|
|
241
|
+
* @returns `true` if the results are equal, `false` otherwise.
|
|
242
|
+
*/
|
|
243
|
+
equals: (e, s, r = {
|
|
244
|
+
valueEquals: (i, t) => i === t,
|
|
245
|
+
errorEquals: (i, t) => i === t
|
|
246
|
+
}) => e.type === "Success" && s.type === "Success" ? r.valueEquals(e.value, s.value) : e.type === "Failure" && s.type === "Failure" ? r.errorEquals(e.error, s.error) : !1,
|
|
247
|
+
/**
|
|
248
|
+
* Combines multiple results into a single result.
|
|
249
|
+
* @param results - The results to combine.
|
|
250
|
+
* @returns A single result that is a success if all the input results are successes, otherwise a failure.
|
|
251
|
+
*/
|
|
252
|
+
all: (e) => {
|
|
253
|
+
const s = [];
|
|
254
|
+
for (const r of e)
|
|
255
|
+
if (u.isSuccess(r))
|
|
256
|
+
s.push(r.value);
|
|
257
|
+
else
|
|
258
|
+
return r;
|
|
259
|
+
return u.success(s);
|
|
260
|
+
}
|
|
226
261
|
};
|
|
227
262
|
export {
|
|
228
263
|
u as R,
|
|
229
|
-
|
|
264
|
+
a as V
|
|
230
265
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./async-result.cjs"),l={valid:{type:"valid"},invalid(e){return{type:"invalid",error:e}},isValid(e){return e.type==="valid"},isInvalid(e){return e.type==="invalid"},match:(e,s,r)=>l.isValid(e)?s():r(e.error),toResult:(e,s)=>l.match(e,()=>u.success(s),r=>u.failure(r)),whenValid:(e,s)=>(l.isValid(e)&&s(),e),whenInvalid:(e,s)=>(l.isInvalid(e)&&s(e.error),e)},u={success(e){return{type:"Success",value:e}},failure(e){return{type:"Failure",error:e}},map:(e,s)=>e.type==="Success"?u.success(s(e.value)):e,flatMap:(e,s)=>e.type==="Success"?s(e.value):e,toAsync(e){return u.match(e,s=>c.AsyncResult.success(s),s=>c.AsyncResult.failure(s))},toValidation(e){return u.match(e,()=>l.valid,s=>l.invalid(s))},isSuccess(e){return e.type==="Success"},isFailure(e){return e.type==="Failure"},getOrElse(e,s){return u.isSuccess(e)?e.value:s},getOrElseLazy(e,s){return u.isSuccess(e)?e.value:s()},getOrNull(e){return u.isSuccess(e)?e.value:null},getOrUndefined(e){return u.isSuccess(e)?e.value:void 0},getUnsafe:e=>{if(u.isSuccess(e))return e.value;throw e.error},match:(e,s,r)=>u.isSuccess(e)?s(e.value):r(e.error),whenSuccess:(e,s)=>(u.isSuccess(e)&&s(e.value),e),whenFailure:(e,s)=>(u.isFailure(e)&&s(e.error),e),combine:(e,s,r,i)=>u.match(e,t=>u.match(s,a=>u.success(r(t,a)),a=>u.failure(a)),t=>u.match(s,a=>u.failure(t),a=>u.failure(i(t,a)))),equals:(e,s,r={valueEquals:(i,t)=>i===t,errorEquals:(i,t)=>i===t})=>e.type==="Success"&&s.type==="Success"?r.valueEquals(e.value,s.value):e.type==="Failure"&&s.type==="Failure"?r.errorEquals(e.error,s.error):!1,all:e=>{const s=[];for(const r of e)if(u.isSuccess(r))s.push(r.value);else return r;return u.success(s)}};exports.Result=u;exports.Validation=l;
|
package/result.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./async-result.cjs");const e=require("./result-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./async-result.cjs");const e=require("./result-CdwVhaAc.cjs");exports.Result=e.Result;
|
package/result.d.ts
CHANGED
|
@@ -7,19 +7,19 @@ import { Validation } from './validation';
|
|
|
7
7
|
* @typeParam V - The type of the value.
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
type: 'Success';
|
|
12
|
-
value: V;
|
|
13
|
-
}
|
|
10
|
+
export type Success<V> = {
|
|
11
|
+
readonly type: 'Success';
|
|
12
|
+
readonly value: V;
|
|
13
|
+
};
|
|
14
14
|
/**
|
|
15
15
|
* Represents a failure result.
|
|
16
16
|
* @typeParam E - The type of the error.
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
20
|
-
type: 'Failure';
|
|
21
|
-
error: E;
|
|
22
|
-
}
|
|
19
|
+
export type Failure<E> = {
|
|
20
|
+
readonly type: 'Failure';
|
|
21
|
+
readonly error: E;
|
|
22
|
+
};
|
|
23
23
|
/**
|
|
24
24
|
* Represents a result that can either be a success or a failure.
|
|
25
25
|
* @typeParam V - The type of the value in case of success.
|
|
@@ -127,6 +127,12 @@ export declare const Result: {
|
|
|
127
127
|
* @public
|
|
128
128
|
*/
|
|
129
129
|
getOrUndefined<V, E>(r: Result<V, E>): Maybe<V>;
|
|
130
|
+
/**
|
|
131
|
+
* Gets the value of a `Result` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
132
|
+
* @param r - The `Result` to get the value from.
|
|
133
|
+
* @returns The value of the `Result` if it is a `Success`.
|
|
134
|
+
*/
|
|
135
|
+
getUnsafe: <V, E>(r: Result<V, E>) => V;
|
|
130
136
|
/**
|
|
131
137
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
132
138
|
* @param success - The function to call if the result is a success.
|
|
@@ -153,4 +159,21 @@ export declare const Result: {
|
|
|
153
159
|
* @public
|
|
154
160
|
*/
|
|
155
161
|
combine: <V, E>(r1: Result<V, E>, r2: Result<V, E>, combineV: (v1: V, v2: V) => V, combineE: (e1: E, e2: E) => E) => Result<V, E>;
|
|
162
|
+
/**
|
|
163
|
+
* Compares two results for equality.
|
|
164
|
+
* @param r1 - The first result.
|
|
165
|
+
* @param r2 - The second result.
|
|
166
|
+
* @param options - The options to use for comparison. By default, uses strict equality.
|
|
167
|
+
* @returns `true` if the results are equal, `false` otherwise.
|
|
168
|
+
*/
|
|
169
|
+
equals: <V, E>(r1: Result<V, E>, r2: Result<V, E>, options?: {
|
|
170
|
+
valueEquals: (v1: V, v2: V) => boolean;
|
|
171
|
+
errorEquals: (e1: E, e2: E) => boolean;
|
|
172
|
+
}) => boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Combines multiple results into a single result.
|
|
175
|
+
* @param results - The results to combine.
|
|
176
|
+
* @returns A single result that is a success if all the input results are successes, otherwise a failure.
|
|
177
|
+
*/
|
|
178
|
+
all: <V, E>(results: Result<V, E>[]) => Result<V[], E>;
|
|
156
179
|
};
|
package/result.js
CHANGED
package/string.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)
|
|
3
|
-
`)>=0?
|
|
4
|
-
`)
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./array.cjs"),m=require("./error.cjs"),A=require("./regexp.cjs"),u=(t,e,n)=>t.split(e).join(n),_=(t,e)=>{const n=t.indexOf(e);return n<0?"":t.substring(n+e.length)},k=(t,e)=>{const n=t.lastIndexOf(e);return n<0?"":t.substring(n+e.length)},H=(t,e)=>{const n=t.indexOf(e);return n<0?"":t.substring(0,n)},$=(t,e)=>{const n=t.lastIndexOf(e);return n<0?"":t.substring(0,n)},h=t=>t.substring(0,1).toUpperCase()+t.substring(1),b=t=>t.toUpperCase(),D=(t,e=!1)=>e?A.mapRegExp(h(t),qt,b):A.mapRegExp(h(t),$t,b),R=t=>t.replace(Qt,`
|
|
2
|
+
`),q=(t,e)=>t==null&&e==null?0:t==null?-1:e==null?1:I(t.toLowerCase(),e.toLowerCase()),d=(t,e)=>t.substring(0,t.length-e.length)===e,P=(t,e)=>t.substring(0,t.length-e.length).toLowerCase()===e.toLowerCase(),L=(t,e)=>t.substring(0,e.length)===e,Z=(t,e)=>t.substring(0,e.length).toLowerCase()===e.toLowerCase(),Q=(t,e)=>y(t.toLowerCase(),e.map(n=>n.toLowerCase())),G=(t,e)=>B(t.toLowerCase(),e.map(n=>n.toLowerCase())),K=t=>t.trim().replace(F," "),I=(t,e)=>t<e?-1:t>e?1:0,C=(t,e)=>t.toLowerCase().includes(e.toLowerCase()),l=(t,e)=>t.includes(e),J=(t,e)=>t.split(e).length-1,V=(t,e)=>c.anyElement(e,n=>C(t,n)),X=(t,e)=>c.anyElement(e,n=>l(t,n)),Y=(t,e)=>c.allElements(e,n=>C(t,n)),v=(t,e)=>c.allElements(e,n=>l(t,n)),tt=t=>t.replace("_","-"),et=(t,e)=>{if(t===e)return-1;const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)if(t.substring(r,r+1)!==e.substring(r,r+1))return r;return n},w=(t,e=20,n="…")=>{const r=t.length,s=n.length;return r>e?e<s?n.slice(s-e,e):t.slice(0,e-s)+n:t},nt=(t,e=20,n="…")=>{const r=t.length,s=n.length;if(r>e){if(e<=s)return w(t,e,n);const a=Math.ceil((e-s)/2),g=Math.floor((e-s)/2);return t.slice(0,a)+n+t.slice(r-g)}else return t},y=(t,e)=>c.anyElement(e,n=>d(t,n)),rt=(t,e)=>p(t).filter(e).join(""),st=(t,e)=>T(t).filter(e).map(r=>String.fromCharCode(r)).join(""),it=(t,e=2166136261)=>{let n=e;for(let r=0,s=t.length;r<s;r++)n^=t.charCodeAt(r),n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24);return n>>>0},ot=t=>t!=null&&t.length>0,ct=t=>u(M(t),"_"," "),at=t=>t.length>0&&!Rt.test(t),ut=t=>Pt.test(t),lt=t=>!Dt.test(t),gt=t=>t.toLowerCase()===t,pt=t=>t.toUpperCase()===t,ht=(t,e)=>t!=null&&t!==""?t:e,ft=t=>Zt.test(t),dt=t=>t==null||t==="",Ct=t=>t.substring(0,1).toLowerCase()+t.substring(1),E=(t,e=1)=>t.substring(Math.floor((t.length-e+1)*Math.random()),e),x=(t,e)=>c.generateArray(e,()=>E(t)).join(""),St=t=>x(Ht,t),At=(t,e)=>p(e).map(t),bt=(t,e)=>u(t,e,""),mt=(t,e)=>d(t,e)?t.substring(0,t.length-e.length):t,Lt=(t,e,n)=>t.substring(0,e)+t.substring(e+n),It=(t,e)=>L(t,e)?t.substring(e.length):t,wt=(t,e)=>{const n=t.indexOf(e);return n<0?t:t.substring(0,n)+t.substring(n+e.length)},S=(t,e)=>c.createFilledArray(e,t).join(""),yt=t=>{const e=p(t);return e.reverse(),e.join("")},W=(t,e="'")=>e==="'"?t.includes("'")?t.includes('"')?"'"+u(t,"'","\\'")+"'":'"'+t+'"':"'"+t+"'":t.includes('"')?t.includes("'")?'"'+u(t,'"','\\"')+'"':"'"+t+"'":'"'+t+'"',O=(t,e="'")=>e+u(t,e,"\\"+e)+e,Et=(t,e="'")=>t.indexOf(`
|
|
3
|
+
`)>=0?O(t,"`"):W(t,e),xt=(t,e)=>{const n=t.indexOf(e);return n<0?[t]:[t.substring(0,n),t.substring(n+e.length)]},B=(t,e)=>c.anyElement(e,n=>t.startsWith(n)),Wt=(t,e,n=e)=>`${e}${t}${n}`,p=t=>t.split(""),T=t=>c.generateArray(t.length,e=>t.charCodeAt(e)),Ot=(t,e)=>{const n=[];for(;t.length>0;)n.push(t.substring(0,e)),t=t.substring(e,t.length-e);return n},Bt=t=>t.split(U),Tt=(t,e)=>j(z(t,e),e),z=(t,e)=>{let n=0;for(let r=0;r<t.length&&l(e,t.charAt(r));r++)n++;return t.substring(n)},j=(t,e)=>{const n=t.length;let r=n,s;for(let a=0;a<n&&(s=n-a-1,l(e,t.charAt(s)));a++)r=s;return t.substring(0,r)},M=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()),zt=t=>t.substring(0,1).toUpperCase()+t.substring(1),jt=(t,e=78,n="",r=`
|
|
4
|
+
`)=>t.split(U).map(s=>N(s.replace(F," ").trim(),e,n,r)).join(r),f=(t,e)=>{if(e<0||e>=t.length)return!1;const n=t.charCodeAt(e);return n===9||n===10||n===11||n===12||n===13||n===32},Mt=t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");if(typeof btoa<"u")return btoa(t);throw new m.MissingImplementationError("No implementation found for base64 encoding")},Nt=t=>{if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf8");if(typeof atob<"u")return atob(t);throw new m.MissingImplementationError("No implementation found for base64 decoding")},N=(t,e,n,r)=>{const s=[],a=t.length,g=n.length;let o=0;for(e-=g;;){if(o+e>=a-g){s.push(t.substring(o));break}let i=0;for(;!f(t,o+e-i)&&i<e;)i++;if(i===e){for(i=0;!f(t,o+e+i)&&o+e+i<a;)i++;s.push(t.substring(o,o+e+i)),o+=e+i+1}else s.push(t.substring(o,o+e-i)),o+=e-i+1}return n+s.join(r+n)},Ft=(t,e,n)=>{const r=n-t.length;return r>0?S(e,r)+t:t},Ut=(t,e,n)=>{const r=n-t.length;return r>0?t+S(e,r):t},_t=(t,e)=>{const n=t.lastIndexOf(e);return n>=0?[t.substring(0,n),t.substring(n+e.length)]:[t]},kt=(t,e)=>{const n=t.indexOf(e);return n>=0?[t.substring(0,n),t.substring(n+e.length)]:[t]},Ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$t=/[^a-zA-Z]([a-z])/g,Dt=/[^\t\n\r ]/,Rt=/[^a-zA-Z]/,qt=/[ \t\r\n][a-z]/g,Pt=/^[a-z0-9]+$/i,Zt=/^[0-9]+$/,F=/[ \t\r\n]+/g,U=/\r\n|\n\r|\n|\r/g,Qt=/\r\n|\n\r|\r/g;exports.canonicalizeNewlines=R;exports.capitalize=h;exports.capitalizeWords=D;exports.chunkString=Ot;exports.collapseText=K;exports.compareCaseInsensitive=q;exports.compareStrings=I;exports.containsAllText=v;exports.containsAllTextCaseInsensitive=Y;exports.containsAnyText=X;exports.containsAnyTextCaseInsensitive=V;exports.countStringOccurrences=J;exports.dasherize=tt;exports.decodeBase64=Nt;exports.deleteFirstFromString=wt;exports.deleteStringAfter=mt;exports.deleteStringBefore=It;exports.deleteSubstring=bt;exports.ellipsis=w;exports.ellipsisMiddle=nt;exports.encodeBase64=Mt;exports.filterCharcodes=st;exports.filterChars=rt;exports.humanize=ct;exports.ifEmptyString=ht;exports.isAlpha=at;exports.isAlphaNum=ut;exports.isBreakingWhitespace=lt;exports.isDigitsOnly=ft;exports.isEmptyString=dt;exports.isLowerCase=gt;exports.isSpaceAt=f;exports.isUpperCase=pt;exports.jsQuote=Et;exports.lowerCaseFirst=Ct;exports.lpad=Ft;exports.mapChars=At;exports.quote=O;exports.randomString=E;exports.randomStringSequence=x;exports.randomStringSequenceBase64=St;exports.repeatString=S;exports.replaceAll=u;exports.reverseString=yt;exports.rpad=Ut;exports.smartQuote=W;exports.splitStringOnFirst=kt;exports.splitStringOnLast=_t;exports.splitStringOnce=xt;exports.stringContains=l;exports.stringEndsWith=d;exports.stringEndsWithAny=y;exports.stringHasContent=ot;exports.stringHashCode=it;exports.stringStartsWith=L;exports.stringStartsWithAny=B;exports.stringToCharcodes=T;exports.stringToChars=p;exports.stringsDifferAtIndex=et;exports.substringAfter=_;exports.substringAfterLast=k;exports.substringBefore=H;exports.substringBeforeLast=$;exports.surroundString=Wt;exports.textContainsCaseInsensitive=C;exports.textEndsWithAnyCaseInsensitive=Q;exports.textEndsWithCaseInsensitive=P;exports.textStartsWithAnyCaseInsensitive=G;exports.textStartsWithCaseInsensitive=Z;exports.textToLines=Bt;exports.trimChars=Tt;exports.trimCharsLeft=z;exports.trimCharsRight=j;exports.trimStringSlice=Lt;exports.underscore=M;exports.upperCaseFirst=zt;exports.wrapColumns=jt;exports.wrapLine=N;
|