@tolki/utils 1.2.0 → 1.4.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/dist/cast.d.ts +53 -0
- package/dist/cast.d.ts.map +1 -1
- package/dist/cast.js +94 -20
- package/dist/equality.d.ts +67 -9
- package/dist/equality.d.ts.map +1 -1
- package/dist/equality.js +181 -48
- package/dist/exceptions.d.ts +32 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +24 -0
- package/dist/guards.d.ts +113 -0
- package/dist/guards.d.ts.map +1 -1
- package/dist/guards.js +144 -84
- package/dist/index.js +79 -53
- package/dist/keys.d.ts +70 -1
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +73 -17
- package/dist/range.d.ts +23 -0
- package/dist/range.d.ts.map +1 -0
- package/dist/range.js +8 -0
- package/dist/reflect.d.ts +7 -0
- package/dist/reflect.d.ts.map +1 -1
- package/dist/reflect.js +10 -6
- package/dist/sorting.d.ts +20 -0
- package/dist/sorting.d.ts.map +1 -0
- package/dist/sorting.js +18 -0
- package/dist/string.d.ts +10 -0
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +15 -10
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +79 -53
- package/package.json +2 -2
package/dist/keys.js
CHANGED
|
@@ -1,25 +1,81 @@
|
|
|
1
|
-
import { isString as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { isPrototypeObject as c, isString as s, isInteger as b, isMap as p, isNull as N, isUndefined as g, isBoolean as m, isNumber as o, isTruthyObject as a, isFunction as I, isSymbol as S } from "./guards.js";
|
|
2
|
+
const u = 2 ** 63;
|
|
3
|
+
function P(r) {
|
|
4
4
|
return !isNaN(Number(r)) && !isNaN(parseFloat(String(r))) ? Number(r) : r;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function h(r) {
|
|
7
7
|
return r === "__proto__" || r === "constructor" || r === "prototype";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function O(r) {
|
|
10
|
+
return s(r) ? !0 : b(r) ? r >= -u && r < u : !1;
|
|
11
|
+
}
|
|
12
|
+
function K(r) {
|
|
13
|
+
return /^(0|[1-9]\d*)$/.test(r);
|
|
14
|
+
}
|
|
15
|
+
function f(r) {
|
|
16
|
+
if (s(r)) {
|
|
17
|
+
if (/^(0|-?[1-9]\d*)$/.test(r)) {
|
|
18
|
+
const n = Number(r);
|
|
19
|
+
if (Number.isSafeInteger(n))
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
return r;
|
|
23
|
+
}
|
|
24
|
+
if (N(r) || g(r))
|
|
25
|
+
return "";
|
|
26
|
+
if (m(r))
|
|
27
|
+
return r ? 1 : 0;
|
|
28
|
+
if (o(r) || Number.isNaN(r)) {
|
|
29
|
+
const n = Number.isFinite(r) ? BigInt.asIntN(64, BigInt(Math.trunc(r))) : 0n;
|
|
30
|
+
return Number.isSafeInteger(Number(n)) ? Number(n) : String(n);
|
|
31
|
+
}
|
|
32
|
+
return String(r);
|
|
33
|
+
}
|
|
34
|
+
function x(r) {
|
|
35
|
+
if (!p(r))
|
|
36
|
+
return Object.entries(r);
|
|
37
|
+
const n = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const [t, e] of r) {
|
|
39
|
+
const i = d(t) ? String(f(t)) : void 0;
|
|
40
|
+
n.set(i ?? t, [i ?? String(t), e]);
|
|
41
|
+
}
|
|
42
|
+
return [...n.values()];
|
|
43
|
+
}
|
|
44
|
+
function d(r) {
|
|
45
|
+
return !a(r) && !I(r) && !S(r);
|
|
46
|
+
}
|
|
47
|
+
function _(r) {
|
|
48
|
+
let n = 0;
|
|
49
|
+
return r.map(([t, e]) => K(t) ? [String(n++), e] : [t, e]);
|
|
50
|
+
}
|
|
51
|
+
function j(r) {
|
|
52
|
+
let n = 0;
|
|
53
|
+
return r.map(
|
|
54
|
+
([t, e]) => o(f(t)) ? [String(n++), e] : [t, e]
|
|
55
|
+
);
|
|
11
56
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
57
|
+
function B(r, n, t) {
|
|
58
|
+
if (!c(r)) {
|
|
59
|
+
if (Object.getOwnPropertyDescriptor(r, n)?.configurable === !1) {
|
|
60
|
+
r[n] = t;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
Object.defineProperty(r, n, {
|
|
64
|
+
value: t,
|
|
65
|
+
enumerable: !0,
|
|
66
|
+
writable: !0,
|
|
67
|
+
configurable: !0
|
|
68
|
+
});
|
|
69
|
+
}
|
|
19
70
|
}
|
|
20
71
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
72
|
+
B as defineKey,
|
|
73
|
+
P as entriesKeyValue,
|
|
74
|
+
K as isIntegerLikeKey,
|
|
75
|
+
O as isPhpArrayKey,
|
|
76
|
+
h as isUnsafeKey,
|
|
77
|
+
x as keyedEntries,
|
|
78
|
+
f as phpArrayKey,
|
|
79
|
+
_ as reindexIntegerKeys,
|
|
80
|
+
j as renumberPhpIntegerKeys
|
|
25
81
|
};
|
package/dist/range.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The half-open `[start, end)` window `array_slice($items, $offset, $length)`
|
|
3
|
+
* selects, expressed for `Array.prototype.slice`.
|
|
4
|
+
*/
|
|
5
|
+
export type SliceRange = {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolve `array_slice`'s offset/length pair into a slice window.
|
|
11
|
+
*
|
|
12
|
+
* A negative offset is normalised against the item count BEFORE it is
|
|
13
|
+
* combined with the length, matching `array_slice` — a raw negative offset
|
|
14
|
+
* fed straight into `Array.prototype.slice` combines the two differently.
|
|
15
|
+
*
|
|
16
|
+
* @param count - The number of items being sliced.
|
|
17
|
+
* @param offset - The starting index, negative to count back from the end.
|
|
18
|
+
* @param length - How many items to take, negative to stop that many from
|
|
19
|
+
* the end, or `null` to run to the end.
|
|
20
|
+
* @returns The `start` and `end` bounds to slice with.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveSliceRange(count: number, offset: number, length: number | null): SliceRange;
|
|
23
|
+
//# sourceMappingURL=range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,IAAI,GACtB,UAAU,CASZ"}
|
package/dist/range.js
ADDED
package/dist/reflect.d.ts
CHANGED
|
@@ -23,4 +23,11 @@ export declare function typeOf(v: unknown): string;
|
|
|
23
23
|
* resolveDefault(undefined); -> null
|
|
24
24
|
*/
|
|
25
25
|
export declare function resolveDefault<D>(defaultValue?: D | (() => D)): D | null;
|
|
26
|
+
/**
|
|
27
|
+
* Render a value's type the way PHP's gettype() does, for Arr::array()-style messages.
|
|
28
|
+
*
|
|
29
|
+
* @param value - The value whose type name is needed.
|
|
30
|
+
* @returns The PHP type name ("NULL", "integer", "double", or the JS typeof otherwise).
|
|
31
|
+
*/
|
|
32
|
+
export declare function phpTypeName(value: unknown): string;
|
|
26
33
|
//# sourceMappingURL=reflect.d.ts.map
|
package/dist/reflect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../src/reflect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reflect.d.ts","sourceRoot":"","sources":["../src/reflect.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CASzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAOxE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA6BlD"}
|
package/dist/reflect.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { isNull as n,
|
|
2
|
-
function
|
|
3
|
-
return n(r) ? "object" :
|
|
1
|
+
import { isNull as n, isNumber as t, isInteger as e, isArray as i, isFunction as f, isUndefined as o } from "./guards.js";
|
|
2
|
+
function p(r) {
|
|
3
|
+
return n(r) ? "object" : i(r) ? "array" : typeof r;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function s(r) {
|
|
6
6
|
return r === void 0 ? null : typeof r == "function" ? r() : r;
|
|
7
7
|
}
|
|
8
|
+
function y(r) {
|
|
9
|
+
return n(r) ? "NULL" : t(r) ? e(r) ? "integer" : "double" : i(r) ? "array" : Number.isNaN(r) ? "double" : f(r) ? "object" : o(r) ? "NULL" : typeof r;
|
|
10
|
+
}
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
y as phpTypeName,
|
|
13
|
+
s as resolveDefault,
|
|
14
|
+
p as typeOf
|
|
11
15
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PathKey, SortSpec } from '@tolki/types';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the value a sort descriptor's key names on one item.
|
|
4
|
+
*
|
|
5
|
+
* @param item - The item being sorted.
|
|
6
|
+
* @param key - The descriptor's key path.
|
|
7
|
+
* @returns The value to compare.
|
|
8
|
+
*/
|
|
9
|
+
export type SortValueResolver = (item: unknown, key: PathKey) => unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Build the sort-descriptor comparator factory for one path resolver.
|
|
12
|
+
*
|
|
13
|
+
* `@tolki/utils` sits below every path package, so the caller supplies the
|
|
14
|
+
* resolver: `getNestedValue` for `Arr`/`Obj`, `dataGet` for `Collection`.
|
|
15
|
+
*
|
|
16
|
+
* @param resolve - Reads a descriptor's key off an item.
|
|
17
|
+
* @returns A function building the comparator one sort descriptor implies.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSortSpecComparator(resolve: SortValueResolver): <TValue>(spec: SortSpec<TValue>, forceDescending: boolean) => (a: TValue, b: TValue) => number;
|
|
20
|
+
//# sourceMappingURL=sorting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../src/sorting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKtD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;AAEzE;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,IAC5B,MAAM,EACrC,MAAM,QAAQ,CAAC,MAAM,CAAC,EACtB,iBAAiB,OAAO,KACzB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAkCtC"}
|
package/dist/sorting.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { compareValues as f } from "./equality.js";
|
|
2
|
+
import { isFunction as e, isArray as a, isUndefined as g } from "./guards.js";
|
|
3
|
+
function y(o) {
|
|
4
|
+
return function(r, c) {
|
|
5
|
+
if (e(r))
|
|
6
|
+
return r;
|
|
7
|
+
if (a(r) && e(r[0]))
|
|
8
|
+
return r[0];
|
|
9
|
+
const [t, n] = a(r) ? r : [r, void 0], u = g(n) || n === !0 || n === "asc" || n === "Ascending", m = c || !u;
|
|
10
|
+
return (s, d) => {
|
|
11
|
+
const i = f(o(s, t), o(d, t));
|
|
12
|
+
return m ? -i : i;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
y as createSortSpecComparator
|
|
18
|
+
};
|
package/dist/string.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PathKey } from '@tolki/types';
|
|
1
2
|
/**
|
|
2
3
|
* Convert a string to lower-case.
|
|
3
4
|
*/
|
|
@@ -14,4 +15,13 @@ export declare function lowerFirst(value: string): string;
|
|
|
14
15
|
* Convert the first character of a string to upper-case.
|
|
15
16
|
*/
|
|
16
17
|
export declare function upperFirst(value: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Build Arr::array()'s exact "must be an array" message, shared by every
|
|
20
|
+
* push/array guard so arr, obj, and the path leaf-check agree on one string.
|
|
21
|
+
*
|
|
22
|
+
* @param value - The resolved value that failed the array check.
|
|
23
|
+
* @param key - The key or path used in the error message.
|
|
24
|
+
* @returns The formatted error message.
|
|
25
|
+
*/
|
|
26
|
+
export declare function arrayValueMessage(value: unknown, key: PathKey): string;
|
|
17
27
|
//# sourceMappingURL=string.d.ts.map
|
package/dist/string.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhD"}
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAEtE"}
|
package/dist/string.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import { phpTypeName as t } from "./reflect.js";
|
|
2
|
+
function o(r) {
|
|
2
3
|
return r.toLowerCase();
|
|
3
4
|
}
|
|
4
|
-
function
|
|
5
|
+
function u(r) {
|
|
5
6
|
return r.toUpperCase();
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
function a(r) {
|
|
9
|
+
const e = [...r];
|
|
10
|
+
return e.length === 0 ? r : (e[0] = e[0].toLowerCase(), e.join(""));
|
|
10
11
|
}
|
|
11
12
|
function i(r) {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
13
|
+
const e = [...r];
|
|
14
|
+
return e.length === 0 ? r : (e[0] = e[0].toUpperCase(), e.join(""));
|
|
15
|
+
}
|
|
16
|
+
function p(r, e) {
|
|
17
|
+
return `Array value for key [${String(e)}] must be an array, ${t(r)} found.`;
|
|
14
18
|
}
|
|
15
19
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
p as arrayValueMessage,
|
|
21
|
+
a as lowerFirst,
|
|
22
|
+
o as toLower,
|
|
23
|
+
u as toUpper,
|
|
19
24
|
i as upperFirst
|
|
20
25
|
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from './cast';
|
|
2
2
|
export * from './equality';
|
|
3
|
+
export * from './exceptions';
|
|
3
4
|
export * from './guards';
|
|
4
5
|
export * from './keys';
|
|
6
|
+
export * from './range';
|
|
5
7
|
export * from './reflect';
|
|
8
|
+
export * from './sorting';
|
|
6
9
|
export * from './string';
|
|
7
10
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,55 +1,81 @@
|
|
|
1
|
-
import { castableToArray as
|
|
2
|
-
import { compareValues as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { arrayableItems as i, arrayableValues as t, castableToArray as s, cssListItemToString as o, getAccessibleValues as a, normalizeToArray as p, toArrayable as l, toJsonSerializable as n, toJsonable as y, toPhpKeyString as c } from "./cast.js";
|
|
2
|
+
import { compareValues as u, looseEqual as b, operatorMatch as h, strictEqual as f } from "./equality.js";
|
|
3
|
+
import { ItemNotFoundException as x, MultipleItemsFoundException as S } from "./exceptions.js";
|
|
4
|
+
import { isAccessibleData as A, isArray as N, isBoolean as F, isFalsy as I, isFiniteNumber as K, isFloat as d, isFunction as M, isInteger as T, isIterable as V, isMap as j, isNegativeNumber as v, isNonPrimitive as O, isNull as E, isNumber as k, isObject as L, isObjectAny as U, isPhpAccessible as q, isPhpFalsy as w, isPhpNumeric as z, isPlainObject as D, isPositiveNumber as J, isPrimitive as W, isPrototypeObject as B, isSet as C, isString as R, isStringable as G, isSymbol as H, isTruthy as Q, isTruthyObject as X, isUndefined as Y, isWeakMap as Z, isWeakSet as _, objectToString as $, phpValueMatch as ee, phpValueMatcher as re } from "./guards.js";
|
|
5
|
+
import { defineKey as te, entriesKeyValue as se, isIntegerLikeKey as oe, isPhpArrayKey as ae, isUnsafeKey as pe, keyedEntries as le, phpArrayKey as ne, reindexIntegerKeys as ye, renumberPhpIntegerKeys as ce } from "./keys.js";
|
|
6
|
+
import { resolveSliceRange as ue } from "./range.js";
|
|
7
|
+
import { phpTypeName as he, resolveDefault as fe, typeOf as ge } from "./reflect.js";
|
|
8
|
+
import { createSortSpecComparator as Se } from "./sorting.js";
|
|
9
|
+
import { arrayValueMessage as Ae, lowerFirst as Ne, toLower as Fe, toUpper as Ie, upperFirst as Ke } from "./string.js";
|
|
7
10
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
11
|
+
x as ItemNotFoundException,
|
|
12
|
+
S as MultipleItemsFoundException,
|
|
13
|
+
Ae as arrayValueMessage,
|
|
14
|
+
i as arrayableItems,
|
|
15
|
+
t as arrayableValues,
|
|
16
|
+
s as castableToArray,
|
|
17
|
+
u as compareValues,
|
|
18
|
+
Se as createSortSpecComparator,
|
|
19
|
+
o as cssListItemToString,
|
|
20
|
+
te as defineKey,
|
|
21
|
+
se as entriesKeyValue,
|
|
22
|
+
a as getAccessibleValues,
|
|
23
|
+
A as isAccessibleData,
|
|
24
|
+
N as isArray,
|
|
25
|
+
F as isBoolean,
|
|
26
|
+
I as isFalsy,
|
|
27
|
+
K as isFiniteNumber,
|
|
28
|
+
d as isFloat,
|
|
29
|
+
M as isFunction,
|
|
30
|
+
T as isInteger,
|
|
31
|
+
oe as isIntegerLikeKey,
|
|
32
|
+
V as isIterable,
|
|
33
|
+
j as isMap,
|
|
34
|
+
v as isNegativeNumber,
|
|
35
|
+
O as isNonPrimitive,
|
|
36
|
+
E as isNull,
|
|
37
|
+
k as isNumber,
|
|
38
|
+
L as isObject,
|
|
39
|
+
U as isObjectAny,
|
|
40
|
+
q as isPhpAccessible,
|
|
41
|
+
ae as isPhpArrayKey,
|
|
42
|
+
w as isPhpFalsy,
|
|
43
|
+
z as isPhpNumeric,
|
|
44
|
+
D as isPlainObject,
|
|
45
|
+
J as isPositiveNumber,
|
|
46
|
+
W as isPrimitive,
|
|
47
|
+
B as isPrototypeObject,
|
|
48
|
+
C as isSet,
|
|
49
|
+
R as isString,
|
|
50
|
+
G as isStringable,
|
|
51
|
+
H as isSymbol,
|
|
52
|
+
Q as isTruthy,
|
|
53
|
+
X as isTruthyObject,
|
|
54
|
+
Y as isUndefined,
|
|
55
|
+
pe as isUnsafeKey,
|
|
56
|
+
Z as isWeakMap,
|
|
57
|
+
_ as isWeakSet,
|
|
58
|
+
le as keyedEntries,
|
|
59
|
+
b as looseEqual,
|
|
60
|
+
Ne as lowerFirst,
|
|
61
|
+
p as normalizeToArray,
|
|
62
|
+
$ as objectToString,
|
|
63
|
+
h as operatorMatch,
|
|
64
|
+
ne as phpArrayKey,
|
|
65
|
+
he as phpTypeName,
|
|
66
|
+
ee as phpValueMatch,
|
|
67
|
+
re as phpValueMatcher,
|
|
68
|
+
ye as reindexIntegerKeys,
|
|
69
|
+
ce as renumberPhpIntegerKeys,
|
|
70
|
+
fe as resolveDefault,
|
|
71
|
+
ue as resolveSliceRange,
|
|
72
|
+
f as strictEqual,
|
|
73
|
+
l as toArrayable,
|
|
74
|
+
n as toJsonSerializable,
|
|
75
|
+
y as toJsonable,
|
|
76
|
+
Fe as toLower,
|
|
77
|
+
c as toPhpKeyString,
|
|
78
|
+
Ie as toUpper,
|
|
79
|
+
ge as typeOf,
|
|
80
|
+
Ke as upperFirst
|
|
55
81
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A set of utility functions for the @tolki packages.",
|
|
5
5
|
"author": "Abraham Arango <https://github.com/abetwothree>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tolki/types": "^1.
|
|
18
|
+
"@tolki/types": "^1.7.0"
|
|
19
19
|
},
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"files": [
|