@tolki/utils 1.4.0 → 1.5.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 +47 -5
- package/dist/cast.d.ts.map +1 -1
- package/dist/cast.js +93 -67
- package/dist/equality.d.ts +1 -4
- package/dist/equality.d.ts.map +1 -1
- package/dist/equality.js +76 -75
- package/dist/exceptions.d.ts +28 -0
- package/dist/exceptions.d.ts.map +1 -1
- package/dist/exceptions.js +34 -4
- package/dist/guards.d.ts +29 -2
- package/dist/guards.d.ts.map +1 -1
- package/dist/guards.js +88 -80
- package/dist/index.js +92 -75
- package/dist/keys.d.ts +50 -0
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +71 -45
- package/dist/range.d.ts +70 -0
- package/dist/range.d.ts.map +1 -1
- package/dist/range.js +103 -5
- package/dist/reflect.d.ts +16 -2
- package/dist/reflect.d.ts.map +1 -1
- package/dist/reflect.js +19 -9
- package/dist/sorting.d.ts +16 -2
- package/dist/sorting.d.ts.map +1 -1
- package/dist/sorting.js +27 -13
- package/dist/utils.js +92 -75
- package/package.json +2 -2
package/dist/utils.js
CHANGED
|
@@ -1,81 +1,98 @@
|
|
|
1
|
-
import { arrayableItems as
|
|
2
|
-
import { compareValues as
|
|
3
|
-
import { ItemNotFoundException as
|
|
4
|
-
import { isAccessibleData as
|
|
5
|
-
import { defineKey as
|
|
6
|
-
import { resolveSliceRange as
|
|
7
|
-
import { phpTypeName as
|
|
8
|
-
import { createSortSpecComparator as
|
|
9
|
-
import { arrayValueMessage as
|
|
1
|
+
import { arrayableItems as t, arrayableValues as i, castableToArray as s, cssListItemToString as a, getAccessibleValues as o, normalizeToArray as p, phpIntArgument as n, phpIntCast as l, phpStringCast as y, toArrayable as m, toJsonSerializable as u, toJsonable as c, toPhpKeyString as b } from "./cast.js";
|
|
2
|
+
import { compareValues as g, looseEqual as S, operatorMatch as f, strictEqual as x } from "./equality.js";
|
|
3
|
+
import { InvalidArgumentException as P, ItemNotFoundException as A, MultipleItemsFoundException as d, UnexpectedValueException as v } from "./exceptions.js";
|
|
4
|
+
import { isAccessibleData as E, isArray as N, isBoolean as T, isEnumCase as F, isFalsy as O, isFiniteNumber as V, isFloat as C, isFunction as M, isInteger as j, isIterable as k, isMap as L, isNegativeNumber as U, isNonPrimitive as w, isNull as z, isNumber as D, isObject as R, isObjectAny as q, isPhpAccessible as J, isPhpFalsy as W, isPhpInt as B, isPhpNumeric as G, isPlainObject as H, isPositiveNumber as Q, isPrimitive as X, isPrototypeObject as Y, isSet as Z, isString as _, isStringable as $, isSymbol as ee, isTruthy as re, isTruthyObject as te, isUndefined as ie, isWeakMap as se, isWeakSet as ae, objectToString as oe, phpValueMatch as pe, phpValueMatcher as ne } from "./guards.js";
|
|
5
|
+
import { arrayKeyExistsError as ye, defineKey as me, entriesKeyValue as ue, hasOwnToString as ce, isIllegalOffset as be, isIntegerLikeKey as he, isPhpArrayKey as ge, isUnsafeKey as Se, keyedEntries as fe, phpArrayKey as xe, phpComputedKey as Ie, reindexIntegerKeys as Pe, renumberPhpIntegerKeys as Ae } from "./keys.js";
|
|
6
|
+
import { resolvePadLength as ve, resolveRangeSize as Ke, resolveSliceRange as Ee, resolveSpliceRange as Ne, resolveTakeCount as Te } from "./range.js";
|
|
7
|
+
import { phpDebugType as Oe, phpTypeName as Ve, resolveDefault as Ce, typeOf as Me } from "./reflect.js";
|
|
8
|
+
import { createSortSpecComparator as ke, phpSortComparator as Le } from "./sorting.js";
|
|
9
|
+
import { arrayValueMessage as we, lowerFirst as ze, toLower as De, toUpper as Re, upperFirst as qe } from "./string.js";
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
P as InvalidArgumentException,
|
|
12
|
+
A as ItemNotFoundException,
|
|
13
|
+
d as MultipleItemsFoundException,
|
|
14
|
+
v as UnexpectedValueException,
|
|
15
|
+
ye as arrayKeyExistsError,
|
|
16
|
+
we as arrayValueMessage,
|
|
17
|
+
t as arrayableItems,
|
|
18
|
+
i as arrayableValues,
|
|
16
19
|
s as castableToArray,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
g as compareValues,
|
|
21
|
+
ke as createSortSpecComparator,
|
|
22
|
+
a as cssListItemToString,
|
|
23
|
+
me as defineKey,
|
|
24
|
+
ue as entriesKeyValue,
|
|
25
|
+
o as getAccessibleValues,
|
|
26
|
+
ce as hasOwnToString,
|
|
27
|
+
E as isAccessibleData,
|
|
24
28
|
N as isArray,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
T as isBoolean,
|
|
30
|
+
F as isEnumCase,
|
|
31
|
+
O as isFalsy,
|
|
32
|
+
V as isFiniteNumber,
|
|
33
|
+
C as isFloat,
|
|
29
34
|
M as isFunction,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
q as
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
35
|
+
be as isIllegalOffset,
|
|
36
|
+
j as isInteger,
|
|
37
|
+
he as isIntegerLikeKey,
|
|
38
|
+
k as isIterable,
|
|
39
|
+
L as isMap,
|
|
40
|
+
U as isNegativeNumber,
|
|
41
|
+
w as isNonPrimitive,
|
|
42
|
+
z as isNull,
|
|
43
|
+
D as isNumber,
|
|
44
|
+
R as isObject,
|
|
45
|
+
q as isObjectAny,
|
|
46
|
+
J as isPhpAccessible,
|
|
47
|
+
ge as isPhpArrayKey,
|
|
48
|
+
W as isPhpFalsy,
|
|
49
|
+
B as isPhpInt,
|
|
50
|
+
G as isPhpNumeric,
|
|
51
|
+
H as isPlainObject,
|
|
52
|
+
Q as isPositiveNumber,
|
|
53
|
+
X as isPrimitive,
|
|
54
|
+
Y as isPrototypeObject,
|
|
55
|
+
Z as isSet,
|
|
56
|
+
_ as isString,
|
|
57
|
+
$ as isStringable,
|
|
58
|
+
ee as isSymbol,
|
|
59
|
+
re as isTruthy,
|
|
60
|
+
te as isTruthyObject,
|
|
61
|
+
ie as isUndefined,
|
|
62
|
+
Se as isUnsafeKey,
|
|
63
|
+
se as isWeakMap,
|
|
64
|
+
ae as isWeakSet,
|
|
65
|
+
fe as keyedEntries,
|
|
66
|
+
S as looseEqual,
|
|
67
|
+
ze as lowerFirst,
|
|
61
68
|
p as normalizeToArray,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
oe as objectToString,
|
|
70
|
+
f as operatorMatch,
|
|
71
|
+
xe as phpArrayKey,
|
|
72
|
+
Ie as phpComputedKey,
|
|
73
|
+
Oe as phpDebugType,
|
|
74
|
+
n as phpIntArgument,
|
|
75
|
+
l as phpIntCast,
|
|
76
|
+
Le as phpSortComparator,
|
|
77
|
+
y as phpStringCast,
|
|
78
|
+
Ve as phpTypeName,
|
|
79
|
+
pe as phpValueMatch,
|
|
80
|
+
ne as phpValueMatcher,
|
|
81
|
+
Pe as reindexIntegerKeys,
|
|
82
|
+
Ae as renumberPhpIntegerKeys,
|
|
83
|
+
Ce as resolveDefault,
|
|
84
|
+
ve as resolvePadLength,
|
|
85
|
+
Ke as resolveRangeSize,
|
|
86
|
+
Ee as resolveSliceRange,
|
|
87
|
+
Ne as resolveSpliceRange,
|
|
88
|
+
Te as resolveTakeCount,
|
|
89
|
+
x as strictEqual,
|
|
90
|
+
m as toArrayable,
|
|
91
|
+
u as toJsonSerializable,
|
|
92
|
+
c as toJsonable,
|
|
93
|
+
De as toLower,
|
|
94
|
+
b as toPhpKeyString,
|
|
95
|
+
Re as toUpper,
|
|
96
|
+
Me as typeOf,
|
|
97
|
+
qe as upperFirst
|
|
81
98
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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.8.0"
|
|
19
19
|
},
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"files": [
|