@tempots/std 0.9.6 → 0.10.3

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.
Files changed (89) hide show
  1. package/README.md +1 -3
  2. package/array.cjs +1 -0
  3. package/array.d.ts +49 -0
  4. package/array.js +223 -0
  5. package/bigint.cjs +1 -0
  6. package/bigint.d.ts +18 -0
  7. package/bigint.js +96 -0
  8. package/boolean.cjs +1 -0
  9. package/boolean.d.ts +23 -0
  10. package/boolean.js +44 -0
  11. package/domain.cjs +1 -0
  12. package/domain.d.ts +22 -0
  13. package/domain.js +1 -0
  14. package/equal.cjs +1 -0
  15. package/equal.d.ts +3 -0
  16. package/equal.js +68 -0
  17. package/function.cjs +1 -0
  18. package/function.d.ts +20 -0
  19. package/function.js +29 -0
  20. package/index.cjs +1 -0
  21. package/index.d.ts +0 -0
  22. package/index.js +1 -0
  23. package/maybe.cjs +1 -0
  24. package/maybe.d.ts +9 -0
  25. package/maybe.js +9 -0
  26. package/number.cjs +1 -0
  27. package/number.d.ts +101 -0
  28. package/number.js +103 -0
  29. package/object.cjs +1 -0
  30. package/object.d.ts +8 -0
  31. package/object.js +30 -0
  32. package/package.json +55 -25
  33. package/regexp.cjs +1 -0
  34. package/regexp.d.ts +10 -0
  35. package/regexp.js +14 -0
  36. package/string.cjs +3 -0
  37. package/string.d.ts +312 -0
  38. package/string.js +396 -0
  39. package/src/arrays.ts +0 -296
  40. package/src/async-result.ts +0 -103
  41. package/src/bigint.ts +0 -111
  42. package/src/booleans.ts +0 -73
  43. package/src/colors/cmyk.ts +0 -84
  44. package/src/colors/convert.ts +0 -1093
  45. package/src/colors/hsl.ts +0 -73
  46. package/src/colors/hsla.ts +0 -45
  47. package/src/colors/hsluv.ts +0 -73
  48. package/src/colors/hsv.ts +0 -75
  49. package/src/colors/lab.ts +0 -69
  50. package/src/colors/lch.ts +0 -53
  51. package/src/colors/luv.ts +0 -56
  52. package/src/colors/rgb.ts +0 -55
  53. package/src/colors/rgba.ts +0 -53
  54. package/src/colors/srgb.ts +0 -72
  55. package/src/colors/xyz.ts +0 -52
  56. package/src/edit.ts +0 -29
  57. package/src/equals.ts +0 -116
  58. package/src/functions.ts +0 -108
  59. package/src/json.ts +0 -52
  60. package/src/match.ts +0 -88
  61. package/src/maybe.ts +0 -32
  62. package/src/memoize.ts +0 -9
  63. package/src/newtype.ts +0 -59
  64. package/src/numbers.ts +0 -222
  65. package/src/objects.ts +0 -47
  66. package/src/ord.ts +0 -79
  67. package/src/reg-exps.ts +0 -48
  68. package/src/result.ts +0 -140
  69. package/src/strings.ts +0 -768
  70. package/src/types/assert.ts +0 -96
  71. package/src/types/differentiate.ts +0 -89
  72. package/src/types/functions.ts +0 -114
  73. package/src/types/generic.ts +0 -42
  74. package/src/types/objects.ts +0 -212
  75. package/src/types/tuples.ts +0 -244
  76. package/src/types/utility.ts +0 -3
  77. package/src/uuid.ts +0 -61
  78. package/src/validation.ts +0 -69
  79. package/test/arrays.spec.ts +0 -410
  80. package/test/colors.spec.ts +0 -406
  81. package/test/commmon.ts +0 -9
  82. package/test/equals.spec.ts +0 -165
  83. package/test/functions.spec.ts +0 -9
  84. package/test/index.d.ts +0 -20
  85. package/test/objects.spec.ts +0 -22
  86. package/test/reg-exps.spec.ts +0 -33
  87. package/test/strings.spec.ts +0 -333
  88. package/test/uuid.spec.ts +0 -35
  89. package/tsconfig.json +0 -19
package/number.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./string.cjs"),s=1e-4,l=1e-9;function f(e,n,t=360){let r=(n-e)%t;return r<0&&(r+=t),r>t/2&&(r-=t),r}function p(e,n){const t=Math.pow(10,n);return Math.ceil(e*t)/t}function c(e,n,t){return Math.min(Math.max(e,n),t)}function g(e,n,t){return Math.trunc(c(e,n,t))}function A(e,n){return c(e,-n,n)}function M(e,n){return e<n?-1:e>n?1:0}function h(e,n){const t=Math.pow(10,n);return Math.floor(e*t)/t}function d(e,n=0){return a.lpad(e.toString(16),"0",n)}function o(e,n,t){return(n-e)*t+e}function w(e,n,t,r=360){return i(o(e,e+f(e,n,r),t),r)}function u(e,n,t=360){let r=(n-e)%t;return r<0&&(r+=t),r>t/2&&(r-=t),r}function C(e,n,t,r=360){return i(o(e,e+u(e,n,r),t),r)}function E(e,n,t,r=360){return e=i(e,r),n=i(n,r),n<e&&(n+=r),i(o(e,n,t),r)}function N(e,n,t,r=360){return e=i(e,r),n=i(n,r),n>e&&(n-=r),i(o(e,n,t),r)}function T(e,n,t=l){return isFinite(e)?isFinite(n)?Math.abs(e-n)<=t:!1:isNaN(e)?isNaN(n):isNaN(n)||isFinite(n)?!1:e>0==n>0}function m(e,n,t=360,r=l){return Math.abs(f(e,n,t))<=r}function S(e,n=l){return Math.abs(e)<=n}function W(e,n){return Math.pow(e,1/n)}function q(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}function O(e){return e<0?-1:1}function y(e,n,t){const r=t-n+1;return e<n&&(e+=r*((n-e)/r+1)),n+(e-n)%r}function i(e,n){return e=e%n,e<0&&(e+=n),e}exports.EPSILON=l;exports.TOLERANCE=s;exports.angleDifference=f;exports.ceilTo=p;exports.clamp=c;exports.clampInt=g;exports.clampSym=A;exports.compare=M;exports.floorTo=h;exports.interpolate=o;exports.interpolateAngle=w;exports.interpolateAngleCCW=N;exports.interpolateAngleCW=E;exports.interpolateWidestAngle=C;exports.nearEqualAngles=m;exports.nearEquals=T;exports.nearZero=S;exports.root=W;exports.roundTo=q;exports.sign=O;exports.toHex=d;exports.widestAngleDifference=u;exports.wrap=y;exports.wrapCircular=i;
package/number.d.ts ADDED
@@ -0,0 +1,101 @@
1
+ export declare const TOLERANCE = 0.0001;
2
+ /**
3
+ Constant value employed to see if two `number` values are very close.
4
+ **/
5
+ export declare const EPSILON = 1e-9;
6
+ /**
7
+ Returns the angular distance between 2 angles.
8
+ **/
9
+ export declare function angleDifference(a: number, b: number, turn?: number): number;
10
+ /**
11
+ Rounds a number up to the specified number of decimals.
12
+ **/
13
+ export declare function ceilTo(v: number, decimals: number): number;
14
+ /**
15
+ `clamp` restricts a value within the specified range.
16
+ ```ts
17
+ log(clamp(1.3, 0, 1)) // prints 1
18
+ log(clamp(0.8, 0, 1)) // prints 0.8
19
+ log(clamp(-0.5, 0, 1)) // prints 0.0
20
+ ```
21
+ **/
22
+ export declare function clamp(value: number, min: number, max: number): number;
23
+ export declare function clampInt(value: number, min: number, max: number): number;
24
+ /**
25
+ Like clamp but you only pass one argument (`max`) that is used as the upper limit
26
+ and the opposite (additive inverse or `-max`) as the lower limit.
27
+ **/
28
+ export declare function clampSym(v: number, max: number): number;
29
+ /**
30
+ It returns the comparison value (an integer number) between two `float` values.
31
+ **/
32
+ export declare function compare(a: number, b: number): number;
33
+ /**
34
+ Rounds a number down to the specified number of decimals.
35
+ **/
36
+ export declare function floorTo(v: number, decimals: number): number;
37
+ export declare function toHex(num: number, length?: number): string;
38
+ /**
39
+ `interpolate` returns a value between `a` and `b` for any value of `t` (normally between 0 and 1).
40
+ **/
41
+ export declare function interpolate(a: number, b: number, t: number): number;
42
+ /**
43
+ Interpolates values in a polar coordinate system looking for the narrowest delta angle.
44
+ It can be either clock-wise or counter-clock-wise.
45
+ **/
46
+ export declare function interpolateAngle(a: number, b: number, t: number, turn?: number): number;
47
+ export declare function widestAngleDifference(a: number, b: number, turn?: number): number;
48
+ /**
49
+ Interpolates values in a polar coordinate system looking for the wideset delta angle.
50
+ It can be either clock-wise or counter-clock-wise.
51
+ **/
52
+ export declare function interpolateWidestAngle(a: number, b: number, t: number, turn?: number): number;
53
+ /**
54
+ Interpolates values in a polar coordinate system always in clock-wise direction.
55
+ **/
56
+ export declare function interpolateAngleCW(a: number, b: number, t: number, turn?: number): number;
57
+ /**
58
+ Interpolates values in a polar coordinate system always in counter-clock-wise direction.
59
+ **/
60
+ export declare function interpolateAngleCCW(a: number, b: number, t: number, turn?: number): number;
61
+ /**
62
+ number numbers can sometime introduce tiny errors even for simple operations.
63
+ `nearEquals` compares two floats using a tiny tollerance (last optional
64
+ argument). By default it is defined as `EPSILON`.
65
+ **/
66
+ export declare function nearEquals(a: number, b: number, tollerance?: number): boolean;
67
+ /**
68
+ number numbers can sometime introduce tiny errors even for simple operations.
69
+ `nearEqualAngles` compares two angles (default is 360deg) using a tiny
70
+ tollerance (last optional argument). By default the tollerance is defined as
71
+ `EPSILON`.
72
+ **/
73
+ export declare function nearEqualAngles(a: number, b: number, turn?: number, tollerance?: number): boolean;
74
+ /**
75
+ `nearZero` finds if the passed number is zero or very close to it. By default
76
+ `EPSILON` is used as the tollerance value.
77
+ **/
78
+ export declare function nearZero(n: number, tollerance?: number): boolean;
79
+ /**
80
+ Computes the nth root (`index`) of `base`.
81
+ **/
82
+ export declare function root(base: number, index: number): number;
83
+ /**
84
+ Rounds a number to the specified number of decimals.
85
+ **/
86
+ export declare function roundTo(f: number, decimals: number): number;
87
+ /**
88
+ `sign` returns `-1` if `value` is a negative number, `1` otherwise.
89
+ */
90
+ export declare function sign<T extends number>(value: T): number;
91
+ /**
92
+ Passed two boundaries values (`min`, `max`), `wrap` ensures that the passed value `v` will
93
+ be included in the boundaries. If the value exceeds `max`, the value is reduced by `min`
94
+ repeatedely until it falls within the range. Similar and inverted treatment is performed if
95
+ the value is below `min`.
96
+ **/
97
+ export declare function wrap(v: number, min: number, max: number): number;
98
+ /**
99
+ Similar to `wrap`, it works for numbers between 0 and `max`.
100
+ **/
101
+ export declare function wrapCircular(v: number, max: number): number;
package/number.js ADDED
@@ -0,0 +1,103 @@
1
+ import { lpad as l } from "./string.js";
2
+ const p = 1e-4, f = 1e-9;
3
+ function u(n, t, e = 360) {
4
+ let r = (t - n) % e;
5
+ return r < 0 && (r += e), r > e / 2 && (r -= e), r;
6
+ }
7
+ function h(n, t) {
8
+ const e = Math.pow(10, t);
9
+ return Math.ceil(n * e) / e;
10
+ }
11
+ function c(n, t, e) {
12
+ return Math.min(Math.max(n, t), e);
13
+ }
14
+ function M(n, t, e) {
15
+ return Math.trunc(c(n, t, e));
16
+ }
17
+ function g(n, t) {
18
+ return c(n, -t, t);
19
+ }
20
+ function N(n, t) {
21
+ return n < t ? -1 : n > t ? 1 : 0;
22
+ }
23
+ function w(n, t) {
24
+ const e = Math.pow(10, t);
25
+ return Math.floor(n * e) / e;
26
+ }
27
+ function A(n, t = 0) {
28
+ return l(n.toString(16), "0", t);
29
+ }
30
+ function o(n, t, e) {
31
+ return (t - n) * e + n;
32
+ }
33
+ function d(n, t, e, r = 360) {
34
+ return i(o(n, n + u(n, t, r), e), r);
35
+ }
36
+ function a(n, t, e = 360) {
37
+ let r = (t - n) % e;
38
+ return r < 0 && (r += e), r > e / 2 && (r -= e), r;
39
+ }
40
+ function C(n, t, e, r = 360) {
41
+ return i(
42
+ o(n, n + a(n, t, r), e),
43
+ r
44
+ );
45
+ }
46
+ function E(n, t, e, r = 360) {
47
+ return n = i(n, r), t = i(t, r), t < n && (t += r), i(o(n, t, e), r);
48
+ }
49
+ function T(n, t, e, r = 360) {
50
+ return n = i(n, r), t = i(t, r), t > n && (t -= r), i(o(n, t, e), r);
51
+ }
52
+ function m(n, t, e = f) {
53
+ return isFinite(n) ? isFinite(t) ? Math.abs(n - t) <= e : !1 : isNaN(n) ? isNaN(t) : isNaN(t) || isFinite(t) ? !1 : n > 0 == t > 0;
54
+ }
55
+ function F(n, t, e = 360, r = f) {
56
+ return Math.abs(u(n, t, e)) <= r;
57
+ }
58
+ function S(n, t = f) {
59
+ return Math.abs(n) <= t;
60
+ }
61
+ function W(n, t) {
62
+ return Math.pow(n, 1 / t);
63
+ }
64
+ function q(n, t) {
65
+ const e = Math.pow(10, t);
66
+ return Math.round(n * e) / e;
67
+ }
68
+ function D(n) {
69
+ return n < 0 ? -1 : 1;
70
+ }
71
+ function I(n, t, e) {
72
+ const r = e - t + 1;
73
+ return n < t && (n += r * ((t - n) / r + 1)), t + (n - t) % r;
74
+ }
75
+ function i(n, t) {
76
+ return n = n % t, n < 0 && (n += t), n;
77
+ }
78
+ export {
79
+ f as EPSILON,
80
+ p as TOLERANCE,
81
+ u as angleDifference,
82
+ h as ceilTo,
83
+ c as clamp,
84
+ M as clampInt,
85
+ g as clampSym,
86
+ N as compare,
87
+ w as floorTo,
88
+ o as interpolate,
89
+ d as interpolateAngle,
90
+ T as interpolateAngleCCW,
91
+ E as interpolateAngleCW,
92
+ C as interpolateWidestAngle,
93
+ F as nearEqualAngles,
94
+ m as nearEquals,
95
+ S as nearZero,
96
+ W as root,
97
+ q as roundTo,
98
+ D as sign,
99
+ A as toHex,
100
+ a as widestAngleDifference,
101
+ I as wrap,
102
+ i as wrapCircular
103
+ };
package/object.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e){return Object.keys(e)}function c(e,t){const u=s(e),r=s(t);if(u.length!==r.length)return!1;for(const n of u)if(!(n in t))return!1;return!0}function i(e){return e!=null&&Object.getPrototypeOf(e)===Object.prototype}function o(e,...t){return s(e).reduce((r,n)=>(t.includes(n)||(r[n]=e[n]),r),{})}function f(e,t){return Object.assign({},e,t)}function l(e){return e==null||i(e)&&Object.keys(e).length===0}exports.isEmpty=l;exports.isObject=i;exports.keys=s;exports.merge=f;exports.removeFields=o;exports.sameKeys=c;
package/object.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { IndexKey, Merge, TupleToUnion } from './domain';
2
+
3
+ export declare function keys<T extends object>(obj: T): Array<keyof T>;
4
+ export declare function sameKeys<T extends object>(a: T, b: T): boolean;
5
+ export declare function isObject(obj: unknown): obj is Record<IndexKey, unknown>;
6
+ export declare function removeFields<T extends object, F extends Array<keyof T>>(ob: T, ...fields: F): Omit<T, TupleToUnion<F>>;
7
+ export declare function merge<A extends Record<IndexKey, unknown>, B extends Record<IndexKey, unknown>>(a: A, b: B): Merge<A, B>;
8
+ export declare function isEmpty(obj: object): boolean;
package/object.js ADDED
@@ -0,0 +1,30 @@
1
+ function s(e) {
2
+ return Object.keys(e);
3
+ }
4
+ function i(e, t) {
5
+ const u = s(e), r = s(t);
6
+ if (u.length !== r.length) return !1;
7
+ for (const n of u)
8
+ if (!(n in t)) return !1;
9
+ return !0;
10
+ }
11
+ function c(e) {
12
+ return e != null && Object.getPrototypeOf(e) === Object.prototype;
13
+ }
14
+ function f(e, ...t) {
15
+ return s(e).reduce((r, n) => (t.includes(n) || (r[n] = e[n]), r), {});
16
+ }
17
+ function o(e, t) {
18
+ return Object.assign({}, e, t);
19
+ }
20
+ function l(e) {
21
+ return e == null || c(e) && Object.keys(e).length === 0;
22
+ }
23
+ export {
24
+ l as isEmpty,
25
+ c as isObject,
26
+ s as keys,
27
+ o as merge,
28
+ f as removeFields,
29
+ i as sameKeys
30
+ };
package/package.json CHANGED
@@ -1,34 +1,64 @@
1
1
  {
2
2
  "name": "@tempots/std",
3
- "version": "0.9.6",
3
+ "version": "0.10.3",
4
4
  "type": "module",
5
- "scripts": {
6
- "watch": "tsc --watch",
7
- "build": "tsc",
8
- "test": "vitest",
9
- "publish": "cp README.md package.json dist && (cd dist && npm publish --access public)"
5
+ "exports": {
6
+ "array": {
7
+ "import": "./array.js",
8
+ "require": "./array.cjs"
9
+ },
10
+ "bigint": {
11
+ "import": "./bigint.js",
12
+ "require": "./bigint.cjs"
13
+ },
14
+ "boolean": {
15
+ "import": "./boolean.js",
16
+ "require": "./boolean.cjs"
17
+ },
18
+ "domain": {
19
+ "import": "./domain.js",
20
+ "require": "./domain.cjs"
21
+ },
22
+ "equal": {
23
+ "import": "./equal.js",
24
+ "require": "./equal.cjs"
25
+ },
26
+ "function": {
27
+ "import": "./function.js",
28
+ "require": "./function.cjs"
29
+ },
30
+ "index": {
31
+ "import": "./index.js",
32
+ "require": "./index.cjs"
33
+ },
34
+ "maybe": {
35
+ "import": "./maybe.js",
36
+ "require": "./maybe.cjs"
37
+ },
38
+ "number": {
39
+ "import": "./number.js",
40
+ "require": "./number.cjs"
41
+ },
42
+ "object": {
43
+ "import": "./object.js",
44
+ "require": "./object.cjs"
45
+ },
46
+ "regexp": {
47
+ "import": "./regexp.js",
48
+ "require": "./regexp.cjs"
49
+ },
50
+ "string": {
51
+ "import": "./string.js",
52
+ "require": "./string.cjs"
53
+ }
10
54
  },
11
- "devDependencies": {
12
- "@types/node": "^18.15.11",
13
- "@typescript-eslint/eslint-plugin": "^5.43.0",
14
- "eslint": "^8.0.1",
15
- "eslint-config-standard-with-typescript": "^34.0.1",
16
- "eslint-plugin-import": "^2.25.2",
17
- "eslint-plugin-n": "^15.0.0",
18
- "eslint-plugin-promise": "^6.0.0",
19
- "typescript": "^5.0.3",
20
- "vitest": "^0.29.8"
21
- },
22
- "main": "index.js",
55
+ "license": "Apache-2.0",
23
56
  "repository": {
24
57
  "type": "git",
25
- "url": "git+https://github.com/fponticelli/tempots-std.git"
58
+ "url": "git+https://github.com/fponticelli/tempots.git"
26
59
  },
27
- "author": "Franco Ponticelli",
28
- "license": "Apache-2.0",
29
60
  "bugs": {
30
- "url": "https://github.com/fponticelli/tempots-std/issues"
61
+ "url": "https://github.com/fponticelli/tempots/issues"
31
62
  },
32
- "homepage": "https://github.com/fponticelli/tempots-std#readme",
33
- "description": ""
34
- }
63
+ "homepage": "https://github.com/fponticelli/tempots#readme"
64
+ }
package/regexp.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(i,s,u){const n=[];let l=0,e;if(s.global)for(s.lastIndex=0;(e=s.exec(i))!==null;)n.push(i.substring(l,e.index)),n.push(u(...e)),l=e.index+e[0].length;else for(;(e=s.exec(i.substring(l)))!==null;)n.push(i.substring(l,l+e.index)),n.push(u(...e)),l+=e.index+e[0].length;return n.push(i.substring(l)),n.join("")}exports.map=g;
package/regexp.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Utility module to manipulate `RegExp` instances.
3
+ */
4
+ /**
5
+ * Map the function `f` on each occurance matched by the pattern.
6
+ * @param f
7
+ * @param pattern
8
+ * @param subject
9
+ */
10
+ export declare function map(subject: string, pattern: RegExp, f: (...s: string[]) => string): string;
package/regexp.js ADDED
@@ -0,0 +1,14 @@
1
+ function h(e, i, u) {
2
+ const s = [];
3
+ let n = 0, l;
4
+ if (i.global)
5
+ for (i.lastIndex = 0; (l = i.exec(e)) !== null; )
6
+ s.push(e.substring(n, l.index)), s.push(u(...l)), n = l.index + l[0].length;
7
+ else
8
+ for (; (l = i.exec(e.substring(n))) !== null; )
9
+ s.push(e.substring(n, n + l.index)), s.push(u(...l)), n += l.index + l[0].length;
10
+ return s.push(e.substring(n)), s.join("");
11
+ }
12
+ export {
13
+ h as map
14
+ };
package/string.cjs ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./array.cjs"),A=require("./regexp.cjs");function l(n,t,e){return n.split(t).join(e)}function U(n,t){const e=n.indexOf(t);return e<0?"":n.substring(e+t.length)}function _(n,t){const e=n.lastIndexOf(t);return e<0?"":n.substring(e+t.length)}function k(n,t){const e=n.indexOf(t);return e<0?"":n.substring(0,e)}function q(n,t){const e=n.lastIndexOf(t);return e<0?"":n.substring(0,e)}function h(n){return n.substring(0,1).toUpperCase()+n.substring(1)}const m=n=>n.toUpperCase();function $(n,t=!1){return t?A.map(h(n),Fn,m):A.map(h(n),Rn,m)}function P(n){return n.replace(Jn,`
2
+ `)}function x(n,t){return n==null&&t==null?0:n==null?-1:t==null?1:I(n.toLowerCase(),t.toLowerCase())}function d(n,t){return n.substring(0,n.length-t.length)===t}function R(n,t){return n.substring(0,n.length-t.length).toLowerCase()===t.toLowerCase()}function L(n,t){return n.substring(0,t.length)===t}function Z(n,t){return n.substring(0,t.length).toLowerCase()===t.toLowerCase()}function D(n,t){return y(n.toLowerCase(),t.map(e=>e.toLowerCase()))}function F(n,t){return O(n.toLowerCase(),t.map(e=>e.toLowerCase()))}function G(n){return n.trim().replace(M," ")}function I(n,t){return n<t?-1:n>t?1:0}function C(n,t){return n.toLowerCase().includes(t.toLowerCase())}function a(n,t){return n.includes(t)}function H(n,t){return n.split(t).length-1}function K(n,t){return u.any(t,e=>C(n,e))}function J(n,t){return u.any(t,e=>a(n,e))}function Q(n,t){return u.all(t,e=>C(n,e))}function V(n,t){return u.all(t,e=>a(n,e))}function X(n){return n.replace("_","-")}function Y(n,t){const e=Math.min(n.length,t.length);for(let r=0;r<e;r++)if(n.substring(r,r+1)!==t.substring(r,r+1))return r;return e}function w(n,t=20,e="…"){const r=n.length,i=e.length;return r>t?t<i?e.substr(i-t,t):n.substr(0,t-i)+e:n}function v(n,t=20,e="…"){const r=n.length,i=e.length;if(r>t){if(t<=i)return w(n,t,e);const c=Math.ceil((t-i)/2),f=Math.floor((t-i)/2);return n.substr(0,c)+e+n.substr(r-f,f)}else return n}function y(n,t){return u.any(t,e=>d(n,e))}function nn(n,t){return p(n).filter(t).join("")}function tn(n,t){return z(n).filter(t).map(r=>String.fromCharCode(r)).join("")}function en(n,t){const e=n.indexOf(t);return e<0?"":n.substring(e)}function rn(n,t=2166136261){let e=t;for(let r=0,i=n.length;r<i;r++)e^=n.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function sn(n){return n!=null&&n.length>0}function on(n){return l(T(n),"_"," ")}function un(n){return n.length>0&&!Dn.test(n)}function cn(n){return Gn.test(n)}function fn(n){return!Zn.test(n)}function an(n){return n.toLowerCase()===n}function ln(n){return n.toUpperCase()===n}function pn(n,t){return n!=null&&n!==""?n:t}function hn(n){return Hn.test(n)}function gn(n){return n==null||n===""}function dn(n){return n.substring(0,1).toLowerCase()+n.substring(1)}function W(n,t=1){return n.substring(Math.floor((n.length-t+1)*Math.random()),t)}function S(n,t){return u.range(t,()=>W(n)).join("")}function Cn(n){return S(xn,n)}function bn(n,t){return p(t).map(n)}function An(n,t){return l(n,t,"")}function mn(n,t){return d(n,t)?n.substring(0,n.length-t.length):n}function Ln(n,t,e){return n.substring(0,t)+n.substring(t+e)}function In(n,t){return L(n,t)?n.substring(t.length):n}function wn(n,t){const e=n.indexOf(t);return e<0?n:n.substring(0,e)+n.substring(e+t.length)}function b(n,t){return u.fill(t,n).join("")}function yn(n){const t=p(n);return t.reverse(),t.join("")}function Wn(n){return n.includes('"')?n.includes("'")?'"'+l(n,'"','\\"')+'"':"'"+n+"'":'"'+n+'"'}function Sn(n,t){const e=n.indexOf(t);return e<0?[n]:[n.substring(0,e),n.substring(e+t.length)]}function O(n,t){return u.any(t,e=>n.startsWith(e))}function On(n){return n.replace(Kn,"")}function zn(n,t,e=t){return`${t}${n}${e}`}function p(n){return n.split("")}function z(n){return u.range(n.length,t=>n.charCodeAt(t))}function Bn(n,t){const e=[];for(;n.length>0;)e.push(n.substring(0,t)),n=n.substr(t,n.length-t);return e}function En(n){return n.split(N)}function Tn(n,t){return E(B(n,t),t)}function B(n,t){let e=0;for(let r=0;r<n.length&&a(t,n.charAt(r));r++)e++;return n.substring(e)}function E(n,t){const e=n.length;let r=e,i;for(let c=0;c<e&&(i=e-c-1,a(t,n.charAt(i)));c++)r=i;return n.substring(0,r)}function T(n){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()}function jn(n){return n.substring(0,1).toUpperCase()+n.substring(1)}function Mn(n,t){const e=n.indexOf(t);return e<0?n:n.substring(0,e)}function Nn(n,t=78,e="",r=`
3
+ `){return n.split(N).map(i=>j(i.replace(M," ").trim(),t,e,r)).join(r)}function g(n,t){if(t<0||t>=n.length)return!1;const e=n.charCodeAt(t);return e===9||e===10||e===11||e===12||e===13||e===32}function Un(n){if(typeof Buffer<"u")return Buffer.from(n).toString("base64");if(typeof btoa<"u")return btoa(n);throw new Error("no implementation provided for base64 encoding")}function _n(n){if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8");if(typeof atob<"u")return atob(n);throw new Error("no implementation provided for base64 decoding")}function j(n,t,e,r){const i=[],c=n.length,f=e.length;let o=0;for(t-=f;;){if(o+t>=c-f){i.push(n.substring(o));break}let s=0;for(;!g(n,o+t-s)&&s<t;)s++;if(s===t){for(s=0;!g(n,o+t+s)&&o+t+s<c;)s++;i.push(n.substring(o,o+t+s)),o+=t+s+1}else i.push(n.substring(o,o+t-s)),o+=t-s+1}return e+i.join(r+e)}function kn(n,t,e){const r=e-n.length;return r>0?b(t,r)+n:n}function qn(n,t,e){const r=e-n.length;return r>0?n+b(t,r):n}function $n(n,t){const e=n.lastIndexOf(t);return e>=0?[n.substring(0,e),n.substring(e+t.length)]:[n]}function Pn(n,t){const e=n.indexOf(t);return e>=0?[n.substring(0,e),n.substring(e+t.length)]:[n]}const xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rn=/[^a-zA-Z]([a-z])/g,Zn=/[^\t\n\r ]/,Dn=/[^a-zA-Z]/,Fn=/[ \t\r\n][a-z]/g,Gn=/^[a-z0-9]+$/i,Hn=/^[0-9]+$/,Kn=/<\/?[a-z]+[^>]*>/gi,M=/[ \t\r\n]+/g,N=/\r\n|\n\r|\n|\r/g,Jn=/\r\n|\n\r|\r/g;exports.after=U;exports.afterLast=_;exports.before=k;exports.beforeLast=q;exports.canonicalizeNewlines=P;exports.capitalize=h;exports.capitalizeWords=$;exports.collapse=G;exports.compare=I;exports.compareCaseInsensitive=x;exports.contains=a;exports.containsAll=V;exports.containsAllCaseInsensitive=Q;exports.containsAny=J;exports.containsAnyCaseInsensitive=K;exports.containsCaseInsensitive=C;exports.count=H;exports.dasherize=X;exports.decodeBase64=_n;exports.diffIndex=Y;exports.ellipsis=w;exports.ellipsisMiddle=v;exports.encodeBase64=Un;exports.endsWith=d;exports.endsWithAny=y;exports.endsWithAnyCaseInsensitive=D;exports.endsWithCaseInsensitive=R;exports.filter=nn;exports.filterCharcode=tn;exports.from=en;exports.hasContent=sn;exports.hashCode=rn;exports.humanize=on;exports.ifEmpty=pn;exports.isAlpha=un;exports.isAlphaNum=cn;exports.isBreakingWhitespace=fn;exports.isDigitsOnly=hn;exports.isEmpty=gn;exports.isLowerCase=an;exports.isSpaceAt=g;exports.isUpperCase=ln;exports.lowerCaseFirst=dn;exports.lpad=kn;exports.map=bn;exports.quote=Wn;exports.random=W;exports.randomSequence=S;exports.randomSequence64=Cn;exports.remove=An;exports.removeAfter=mn;exports.removeAt=Ln;exports.removeBefore=In;exports.removeOne=wn;exports.repeat=b;exports.replace=l;exports.reverse=yn;exports.rpad=qn;exports.splitOnFirst=Pn;exports.splitOnLast=$n;exports.splitOnce=Sn;exports.startsWith=L;exports.startsWithAny=O;exports.startsWithAnyCaseInsensitive=F;exports.startsWithCaseInsensitive=Z;exports.stripTags=On;exports.surround=zn;exports.toArray=p;exports.toCharcodes=z;exports.toChunks=Bn;exports.toLines=En;exports.trimChars=Tn;exports.trimCharsLeft=B;exports.trimCharsRight=E;exports.underscore=T;exports.upTo=Mn;exports.upperCaseFirst=jn;exports.wrapColumns=Nn;exports.wrapLine=j;