es-toolkit 1.10.1 → 1.11.0-dev.263
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/CHANGELOG.md +33 -0
- package/compat.d.ts +1 -0
- package/dist/array/chunk.mjs +1 -1
- package/dist/array/compact.mjs +1 -1
- package/dist/array/countBy.mjs +1 -1
- package/dist/array/difference.mjs +1 -1
- package/dist/array/differenceBy.mjs +1 -1
- package/dist/array/differenceWith.mjs +1 -1
- package/dist/array/drop.js +1 -0
- package/dist/array/drop.js.map +1 -1
- package/dist/array/drop.mjs +2 -2
- package/dist/array/dropRight.js +5 -1
- package/dist/array/dropRight.js.map +1 -1
- package/dist/array/dropRight.mjs +2 -2
- package/dist/array/dropRightWhile.js +6 -14
- package/dist/array/dropRightWhile.js.map +1 -1
- package/dist/array/dropRightWhile.mjs +2 -3
- package/dist/array/dropWhile.mjs +1 -1
- package/dist/array/fill.d.mts +10 -7
- package/dist/array/fill.d.ts +10 -7
- package/dist/array/fill.js +7 -6
- package/dist/array/fill.js.map +1 -1
- package/dist/array/fill.mjs +2 -2
- package/dist/array/flatMap.d.mts +23 -0
- package/dist/array/flatMap.d.ts +23 -0
- package/dist/array/flatMap.js +52 -0
- package/dist/array/flatMap.js.map +1 -0
- package/dist/array/flatMap.mjs +9 -0
- package/dist/array/flatten.mjs +1 -1
- package/dist/array/flattenDeep.mjs +1 -1
- package/dist/array/forEachRight.mjs +1 -1
- package/dist/array/groupBy.mjs +1 -1
- package/dist/array/head.mjs +1 -1
- package/dist/array/index.d.mts +1 -0
- package/dist/array/index.d.ts +1 -0
- package/dist/array/index.js +30 -14
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +41 -37
- package/dist/array/initial.mjs +1 -1
- package/dist/array/intersection.mjs +1 -1
- package/dist/array/intersectionBy.mjs +1 -1
- package/dist/array/intersectionWith.mjs +1 -1
- package/dist/array/keyBy.mjs +1 -1
- package/dist/array/last.mjs +1 -1
- package/dist/array/maxBy.mjs +1 -1
- package/dist/array/minBy.mjs +1 -1
- package/dist/array/orderBy.mjs +1 -1
- package/dist/array/partition.mjs +1 -1
- package/dist/array/sample.mjs +1 -1
- package/dist/array/sampleSize.mjs +1 -1
- package/dist/array/shuffle.mjs +1 -1
- package/dist/array/tail.mjs +1 -1
- package/dist/array/take.mjs +1 -1
- package/dist/array/takeRight.mjs +1 -1
- package/dist/array/takeRightWhile.mjs +1 -1
- package/dist/array/takeWhile.mjs +1 -1
- package/dist/array/toFilled.mjs +1 -1
- package/dist/array/union.mjs +1 -1
- package/dist/array/unionBy.mjs +1 -1
- package/dist/array/unionWith.mjs +1 -1
- package/dist/array/uniq.mjs +1 -1
- package/dist/array/uniqBy.d.mts +1 -1
- package/dist/array/uniqBy.d.ts +1 -1
- package/dist/array/uniqBy.js.map +1 -1
- package/dist/array/uniqBy.mjs +2 -2
- package/dist/array/uniqWith.mjs +1 -1
- package/dist/array/unzip.mjs +1 -1
- package/dist/array/unzipWith.mjs +1 -1
- package/dist/array/without.mjs +1 -1
- package/dist/array/xor.mjs +1 -1
- package/dist/array/xorBy.mjs +1 -1
- package/dist/array/xorWith.mjs +1 -1
- package/dist/array/zip.mjs +1 -1
- package/dist/array/zipObject.mjs +1 -1
- package/dist/array/zipWith.mjs +1 -1
- package/dist/{chunk-S3CORED5.mjs → chunk-3EZAFZG3.mjs} +2 -1
- package/dist/{chunk-S3CORED5.mjs.map → chunk-3EZAFZG3.mjs.map} +1 -1
- package/dist/{chunk-2MM5EJJX.mjs → chunk-424M7IR7.mjs} +23 -2
- package/dist/chunk-4OIZM4HS.mjs +1 -0
- package/dist/{chunk-GDC64SYJ.mjs → chunk-5ASRKEB4.mjs} +1 -1
- package/dist/{chunk-GDC64SYJ.mjs.map → chunk-5ASRKEB4.mjs.map} +1 -1
- package/dist/{chunk-OXAZEEGP.mjs → chunk-B4COTK4K.mjs} +1 -1
- package/dist/{chunk-OXAZEEGP.mjs.map → chunk-B4COTK4K.mjs.map} +1 -1
- package/dist/chunk-DDH7K4QM.mjs +1 -0
- package/dist/chunk-F47GLYUU.mjs +1 -0
- package/dist/chunk-J3GE7DEU.mjs +22 -0
- package/dist/chunk-J3GE7DEU.mjs.map +1 -0
- package/dist/chunk-KIOYQRMQ.mjs +12 -0
- package/dist/chunk-KIOYQRMQ.mjs.map +1 -0
- package/dist/chunk-M7SBBYV2.mjs +14 -0
- package/dist/chunk-M7SBBYV2.mjs.map +1 -0
- package/dist/{chunk-IZAD2S7R.mjs → chunk-MY4G7R3I.mjs} +2 -2
- package/dist/{chunk-74WWMNZS.mjs → chunk-OLX53VEF.mjs} +4 -2
- package/dist/{chunk-74WWMNZS.mjs.map → chunk-OLX53VEF.mjs.map} +1 -1
- package/dist/chunk-OXZCMC5I.mjs +13 -0
- package/dist/{chunk-JEKUA56R.mjs.map → chunk-OXZCMC5I.mjs.map} +1 -1
- package/dist/chunk-QXTNZR7B.mjs +25 -0
- package/dist/chunk-QXTNZR7B.mjs.map +1 -0
- package/dist/{chunk-QZITBKWX.mjs → chunk-U7V3G7CR.mjs} +2 -2
- package/dist/chunk-UY76KTPE.mjs +13 -0
- package/dist/chunk-UY76KTPE.mjs.map +1 -0
- package/dist/chunk-XT74R35S.mjs +1 -0
- package/dist/chunk-XT74R35S.mjs.map +1 -0
- package/dist/chunk-XWPCDIFC.mjs +18 -0
- package/dist/chunk-XWPCDIFC.mjs.map +1 -0
- package/dist/chunk-YFN6KOC4.mjs +15 -0
- package/dist/chunk-YFN6KOC4.mjs.map +1 -0
- package/dist/compat/index.d.mts +392 -1
- package/dist/compat/index.d.ts +392 -1
- package/dist/compat/index.js +276 -21
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +268 -87
- package/dist/compat/index.mjs.map +1 -1
- package/dist/error/AbortError.mjs +1 -1
- package/dist/error/TimeoutError.d.mts +9 -0
- package/dist/error/TimeoutError.d.ts +9 -0
- package/dist/error/TimeoutError.js +36 -0
- package/dist/error/TimeoutError.js.map +1 -0
- package/dist/error/TimeoutError.mjs +8 -0
- package/dist/error/TimeoutError.mjs.map +1 -0
- package/dist/error/index.d.mts +1 -0
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.js +12 -2
- package/dist/error/index.js.map +1 -1
- package/dist/error/index.mjs +7 -3
- package/dist/function/debounce.mjs +1 -1
- package/dist/function/index.mjs +7 -7
- package/dist/function/negate.mjs +1 -1
- package/dist/function/noop.mjs +1 -1
- package/dist/function/once.mjs +1 -1
- package/dist/function/throttle.mjs +1 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +99 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -87
- package/dist/math/clamp.mjs +1 -1
- package/dist/math/inRange.mjs +1 -1
- package/dist/math/index.js.map +1 -1
- package/dist/math/index.mjs +12 -12
- package/dist/math/mean.d.mts +1 -1
- package/dist/math/mean.d.ts +1 -1
- package/dist/math/mean.js.map +1 -1
- package/dist/math/mean.mjs +2 -2
- package/dist/math/meanBy.js.map +1 -1
- package/dist/math/meanBy.mjs +3 -3
- package/dist/math/random.mjs +1 -1
- package/dist/math/randomInt.mjs +1 -1
- package/dist/math/range.mjs +1 -1
- package/dist/math/round.mjs +1 -1
- package/dist/math/sum.mjs +1 -1
- package/dist/math/sumBy.mjs +1 -1
- package/dist/object/clone.mjs +1 -1
- package/dist/object/index.js +3 -1
- package/dist/object/index.js.map +1 -1
- package/dist/object/index.mjs +6 -6
- package/dist/object/invert.js +3 -1
- package/dist/object/invert.js.map +1 -1
- package/dist/object/invert.mjs +2 -2
- package/dist/object/omit.mjs +2 -2
- package/dist/object/omitBy.mjs +1 -1
- package/dist/object/pick.mjs +1 -1
- package/dist/object/pickBy.mjs +1 -1
- package/dist/predicate/index.mjs +1 -1
- package/dist/predicate/isEqual.mjs +1 -1
- package/dist/predicate/isNil.mjs +1 -1
- package/dist/predicate/isNotNil.mjs +1 -1
- package/dist/predicate/isNull.mjs +1 -1
- package/dist/predicate/isUndefined.mjs +1 -1
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/index.d.mts +1 -0
- package/dist/promise/index.d.ts +1 -0
- package/dist/promise/index.js +47 -2
- package/dist/promise/index.js.map +1 -1
- package/dist/promise/index.mjs +9 -3
- package/dist/promise/timeout.d.mts +10 -0
- package/dist/promise/timeout.d.ts +10 -0
- package/dist/promise/timeout.js +92 -0
- package/dist/promise/timeout.js.map +1 -0
- package/dist/promise/timeout.mjs +11 -0
- package/dist/promise/timeout.mjs.map +1 -0
- package/dist/promise/withTimeout.d.mts +22 -0
- package/dist/promise/withTimeout.d.ts +22 -0
- package/dist/promise/withTimeout.js +99 -0
- package/dist/promise/withTimeout.js.map +1 -0
- package/dist/promise/withTimeout.mjs +12 -0
- package/dist/promise/withTimeout.mjs.map +1 -0
- package/dist/string/camelCase.mjs +1 -1
- package/dist/string/capitalize.mjs +1 -1
- package/dist/string/index.d.mts +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.js +21 -2
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +13 -9
- package/dist/string/kebabCase.mjs +1 -1
- package/dist/string/lowerCase.mjs +1 -1
- package/dist/string/snakeCase.mjs +1 -1
- package/dist/string/startCase.d.mts +16 -0
- package/dist/string/startCase.d.ts +16 -0
- package/dist/string/startCase.js +54 -0
- package/dist/string/startCase.js.map +1 -0
- package/dist/string/startCase.mjs +9 -0
- package/dist/string/startCase.mjs.map +1 -0
- package/package.json +3 -5
- package/dist/chunk-2MRZANXZ.mjs +0 -1
- package/dist/chunk-ARZ5BDR6.mjs +0 -1
- package/dist/chunk-C4WE4GLC.mjs +0 -14
- package/dist/chunk-C4WE4GLC.mjs.map +0 -1
- package/dist/chunk-FZEZH22H.mjs +0 -1
- package/dist/chunk-JE6JKZU3.mjs +0 -15
- package/dist/chunk-JE6JKZU3.mjs.map +0 -1
- package/dist/chunk-JEKUA56R.mjs +0 -9
- package/dist/chunk-QKYYOLJ6.mjs +0 -1
- /package/dist/{chunk-2MM5EJJX.mjs.map → array/flatMap.mjs.map} +0 -0
- /package/dist/{chunk-2MRZANXZ.mjs.map → chunk-424M7IR7.mjs.map} +0 -0
- /package/dist/{chunk-ARZ5BDR6.mjs.map → chunk-4OIZM4HS.mjs.map} +0 -0
- /package/dist/{chunk-FZEZH22H.mjs.map → chunk-DDH7K4QM.mjs.map} +0 -0
- /package/dist/{chunk-QKYYOLJ6.mjs.map → chunk-F47GLYUU.mjs.map} +0 -0
- /package/dist/{chunk-IZAD2S7R.mjs.map → chunk-MY4G7R3I.mjs.map} +0 -0
- /package/dist/{chunk-QZITBKWX.mjs.map → chunk-U7V3G7CR.mjs.map} +0 -0
package/dist/compat/index.mjs
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
import "../chunk-NKLIE2OI.mjs";
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-4OIZM4HS.mjs";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
} from "../chunk-5IKVJGHO.mjs";
|
|
4
|
+
withTimeout
|
|
5
|
+
} from "../chunk-XWPCDIFC.mjs";
|
|
6
|
+
import "../chunk-J3GE7DEU.mjs";
|
|
7
|
+
import "../chunk-XT74R35S.mjs";
|
|
9
8
|
import {
|
|
10
9
|
snakeCase
|
|
11
10
|
} from "../chunk-F3WCQQET.mjs";
|
|
12
|
-
import "../chunk-ARZ5BDR6.mjs";
|
|
13
11
|
import {
|
|
14
|
-
|
|
15
|
-
} from "../chunk-
|
|
12
|
+
startCase
|
|
13
|
+
} from "../chunk-QXTNZR7B.mjs";
|
|
16
14
|
import {
|
|
17
15
|
camelCase
|
|
18
16
|
} from "../chunk-Y5V7UAZZ.mjs";
|
|
19
17
|
import {
|
|
20
18
|
capitalize
|
|
21
19
|
} from "../chunk-U56ZOM7L.mjs";
|
|
22
|
-
import "../chunk-WVQ7YVRK.mjs";
|
|
23
|
-
import "../chunk-OSOLEQLZ.mjs";
|
|
24
|
-
import {
|
|
25
|
-
clone
|
|
26
|
-
} from "../chunk-U4JGKZ56.mjs";
|
|
27
20
|
import {
|
|
28
|
-
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import {
|
|
31
|
-
omit
|
|
32
|
-
} from "../chunk-QZITBKWX.mjs";
|
|
33
|
-
import {
|
|
34
|
-
omitBy
|
|
35
|
-
} from "../chunk-BCTYOXT7.mjs";
|
|
36
|
-
import {
|
|
37
|
-
pick
|
|
38
|
-
} from "../chunk-HPFDYUGP.mjs";
|
|
21
|
+
kebabCase
|
|
22
|
+
} from "../chunk-EYYZQFOP.mjs";
|
|
39
23
|
import {
|
|
40
|
-
|
|
41
|
-
} from "../chunk-
|
|
24
|
+
lowerCase
|
|
25
|
+
} from "../chunk-5IKVJGHO.mjs";
|
|
26
|
+
import "../chunk-WVQ7YVRK.mjs";
|
|
42
27
|
import "../chunk-ASJF5D6C.mjs";
|
|
43
28
|
import {
|
|
44
29
|
isEqual
|
|
@@ -55,32 +40,60 @@ import {
|
|
|
55
40
|
import {
|
|
56
41
|
isUndefined
|
|
57
42
|
} from "../chunk-VH2PV426.mjs";
|
|
43
|
+
import {
|
|
44
|
+
delay
|
|
45
|
+
} from "../chunk-O64NE2P4.mjs";
|
|
46
|
+
import "../chunk-OSOLEQLZ.mjs";
|
|
47
|
+
import {
|
|
48
|
+
pickBy
|
|
49
|
+
} from "../chunk-6CLH5YZ2.mjs";
|
|
50
|
+
import {
|
|
51
|
+
clone
|
|
52
|
+
} from "../chunk-U4JGKZ56.mjs";
|
|
53
|
+
import {
|
|
54
|
+
invert
|
|
55
|
+
} from "../chunk-OLX53VEF.mjs";
|
|
56
|
+
import {
|
|
57
|
+
omit
|
|
58
|
+
} from "../chunk-U7V3G7CR.mjs";
|
|
59
|
+
import {
|
|
60
|
+
omitBy
|
|
61
|
+
} from "../chunk-BCTYOXT7.mjs";
|
|
62
|
+
import {
|
|
63
|
+
pick
|
|
64
|
+
} from "../chunk-HPFDYUGP.mjs";
|
|
58
65
|
import "../chunk-FUS75PJ7.mjs";
|
|
66
|
+
import {
|
|
67
|
+
sumBy
|
|
68
|
+
} from "../chunk-5L4VWRFX.mjs";
|
|
69
|
+
import {
|
|
70
|
+
inRange
|
|
71
|
+
} from "../chunk-BH6HLGBA.mjs";
|
|
59
72
|
import {
|
|
60
73
|
meanBy
|
|
61
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-MY4G7R3I.mjs";
|
|
62
75
|
import {
|
|
63
76
|
mean
|
|
64
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-5ASRKEB4.mjs";
|
|
78
|
+
import {
|
|
79
|
+
sum
|
|
80
|
+
} from "../chunk-2SLTL4KL.mjs";
|
|
65
81
|
import {
|
|
66
82
|
range
|
|
67
83
|
} from "../chunk-DPH2KE6O.mjs";
|
|
68
84
|
import {
|
|
69
85
|
round
|
|
70
86
|
} from "../chunk-5PMKOZ2F.mjs";
|
|
71
|
-
import {
|
|
72
|
-
sumBy
|
|
73
|
-
} from "../chunk-5L4VWRFX.mjs";
|
|
74
|
-
import {
|
|
75
|
-
sum
|
|
76
|
-
} from "../chunk-2SLTL4KL.mjs";
|
|
77
87
|
import {
|
|
78
88
|
clamp
|
|
79
89
|
} from "../chunk-MLCL773E.mjs";
|
|
90
|
+
import "../chunk-DDH7K4QM.mjs";
|
|
80
91
|
import {
|
|
81
|
-
|
|
82
|
-
} from "../chunk-
|
|
83
|
-
import
|
|
92
|
+
without
|
|
93
|
+
} from "../chunk-PYEYV7BY.mjs";
|
|
94
|
+
import {
|
|
95
|
+
xor
|
|
96
|
+
} from "../chunk-L7FQX5MN.mjs";
|
|
84
97
|
import {
|
|
85
98
|
xorBy
|
|
86
99
|
} from "../chunk-Q47NGNXT.mjs";
|
|
@@ -96,12 +109,21 @@ import {
|
|
|
96
109
|
import {
|
|
97
110
|
zipWith
|
|
98
111
|
} from "../chunk-4KYXHZ4R.mjs";
|
|
112
|
+
import {
|
|
113
|
+
union
|
|
114
|
+
} from "../chunk-R6QA7PLZ.mjs";
|
|
115
|
+
import {
|
|
116
|
+
unionBy
|
|
117
|
+
} from "../chunk-NFS7RWWE.mjs";
|
|
99
118
|
import {
|
|
100
119
|
unionWith
|
|
101
120
|
} from "../chunk-2ZCITDMK.mjs";
|
|
121
|
+
import {
|
|
122
|
+
uniq
|
|
123
|
+
} from "../chunk-DVK2N4KC.mjs";
|
|
102
124
|
import {
|
|
103
125
|
uniqBy
|
|
104
|
-
} from "../chunk-
|
|
126
|
+
} from "../chunk-B4COTK4K.mjs";
|
|
105
127
|
import {
|
|
106
128
|
uniqWith
|
|
107
129
|
} from "../chunk-237HGSZS.mjs";
|
|
@@ -112,11 +134,17 @@ import {
|
|
|
112
134
|
unzipWith
|
|
113
135
|
} from "../chunk-IFNXROZR.mjs";
|
|
114
136
|
import {
|
|
115
|
-
|
|
116
|
-
} from "../chunk-
|
|
137
|
+
sampleSize
|
|
138
|
+
} from "../chunk-EHSKB6DF.mjs";
|
|
117
139
|
import {
|
|
118
|
-
|
|
119
|
-
} from "../chunk-
|
|
140
|
+
randomInt
|
|
141
|
+
} from "../chunk-GIWAOOFY.mjs";
|
|
142
|
+
import {
|
|
143
|
+
random
|
|
144
|
+
} from "../chunk-SYWMYQYJ.mjs";
|
|
145
|
+
import {
|
|
146
|
+
shuffle
|
|
147
|
+
} from "../chunk-G7UQ5PUR.mjs";
|
|
120
148
|
import {
|
|
121
149
|
tail
|
|
122
150
|
} from "../chunk-OF6NM4G7.mjs";
|
|
@@ -136,14 +164,11 @@ import {
|
|
|
136
164
|
toFilled
|
|
137
165
|
} from "../chunk-OP4OAKQJ.mjs";
|
|
138
166
|
import {
|
|
139
|
-
|
|
140
|
-
} from "../chunk-
|
|
141
|
-
import {
|
|
142
|
-
uniq
|
|
143
|
-
} from "../chunk-DVK2N4KC.mjs";
|
|
167
|
+
intersectionWith
|
|
168
|
+
} from "../chunk-XI7KRD2C.mjs";
|
|
144
169
|
import {
|
|
145
|
-
|
|
146
|
-
} from "../chunk-
|
|
170
|
+
keyBy
|
|
171
|
+
} from "../chunk-AJKZMN2V.mjs";
|
|
147
172
|
import {
|
|
148
173
|
last
|
|
149
174
|
} from "../chunk-KPBQ7OUY.mjs";
|
|
@@ -163,17 +188,11 @@ import {
|
|
|
163
188
|
sample
|
|
164
189
|
} from "../chunk-2KNLZB7V.mjs";
|
|
165
190
|
import {
|
|
166
|
-
|
|
167
|
-
} from "../chunk-
|
|
168
|
-
import {
|
|
169
|
-
randomInt
|
|
170
|
-
} from "../chunk-GIWAOOFY.mjs";
|
|
171
|
-
import {
|
|
172
|
-
random
|
|
173
|
-
} from "../chunk-SYWMYQYJ.mjs";
|
|
191
|
+
flattenDeep
|
|
192
|
+
} from "../chunk-ML727RRJ.mjs";
|
|
174
193
|
import {
|
|
175
|
-
|
|
176
|
-
} from "../chunk-
|
|
194
|
+
forEachRight
|
|
195
|
+
} from "../chunk-IEA53J7P.mjs";
|
|
177
196
|
import {
|
|
178
197
|
groupBy
|
|
179
198
|
} from "../chunk-E6E4RZLN.mjs";
|
|
@@ -190,35 +209,36 @@ import {
|
|
|
190
209
|
intersectionBy
|
|
191
210
|
} from "../chunk-O6UXZR3U.mjs";
|
|
192
211
|
import {
|
|
193
|
-
|
|
194
|
-
} from "../chunk-
|
|
195
|
-
import {
|
|
196
|
-
keyBy
|
|
197
|
-
} from "../chunk-AJKZMN2V.mjs";
|
|
212
|
+
differenceWith
|
|
213
|
+
} from "../chunk-6NVQAHXP.mjs";
|
|
198
214
|
import {
|
|
199
215
|
drop
|
|
200
|
-
} from "../chunk-
|
|
216
|
+
} from "../chunk-3EZAFZG3.mjs";
|
|
201
217
|
import {
|
|
202
218
|
dropRight
|
|
203
|
-
} from "../chunk-
|
|
219
|
+
} from "../chunk-OXZCMC5I.mjs";
|
|
204
220
|
import {
|
|
205
221
|
dropRightWhile
|
|
206
|
-
} from "../chunk-
|
|
222
|
+
} from "../chunk-M7SBBYV2.mjs";
|
|
207
223
|
import {
|
|
208
224
|
dropWhile
|
|
209
225
|
} from "../chunk-LJ2C6MVP.mjs";
|
|
210
226
|
import {
|
|
211
227
|
fill
|
|
212
|
-
} from "../chunk-
|
|
228
|
+
} from "../chunk-YFN6KOC4.mjs";
|
|
213
229
|
import {
|
|
214
|
-
|
|
215
|
-
} from "../chunk-
|
|
230
|
+
flatMap
|
|
231
|
+
} from "../chunk-UY76KTPE.mjs";
|
|
216
232
|
import {
|
|
217
233
|
flatten
|
|
218
234
|
} from "../chunk-33MSBDC6.mjs";
|
|
235
|
+
import "../chunk-F47GLYUU.mjs";
|
|
219
236
|
import {
|
|
220
|
-
|
|
221
|
-
} from "../chunk-
|
|
237
|
+
AbortError
|
|
238
|
+
} from "../chunk-DXB7EZUQ.mjs";
|
|
239
|
+
import {
|
|
240
|
+
TimeoutError
|
|
241
|
+
} from "../chunk-KIOYQRMQ.mjs";
|
|
222
242
|
import {
|
|
223
243
|
chunk
|
|
224
244
|
} from "../chunk-E6C5EZQA.mjs";
|
|
@@ -234,20 +254,7 @@ import {
|
|
|
234
254
|
import {
|
|
235
255
|
differenceBy
|
|
236
256
|
} from "../chunk-LVWX5B43.mjs";
|
|
237
|
-
import {
|
|
238
|
-
differenceWith
|
|
239
|
-
} from "../chunk-6NVQAHXP.mjs";
|
|
240
|
-
import "../chunk-FZEZH22H.mjs";
|
|
241
|
-
import {
|
|
242
|
-
AbortError
|
|
243
|
-
} from "../chunk-DXB7EZUQ.mjs";
|
|
244
257
|
import "../chunk-236H5JZJ.mjs";
|
|
245
|
-
import {
|
|
246
|
-
once
|
|
247
|
-
} from "../chunk-CMBC4MXG.mjs";
|
|
248
|
-
import {
|
|
249
|
-
throttle
|
|
250
|
-
} from "../chunk-QOJGMVVR.mjs";
|
|
251
258
|
import {
|
|
252
259
|
debounce
|
|
253
260
|
} from "../chunk-3IP4JVLL.mjs";
|
|
@@ -257,7 +264,13 @@ import {
|
|
|
257
264
|
import {
|
|
258
265
|
noop
|
|
259
266
|
} from "../chunk-LKXCOLNY.mjs";
|
|
260
|
-
import
|
|
267
|
+
import {
|
|
268
|
+
once
|
|
269
|
+
} from "../chunk-CMBC4MXG.mjs";
|
|
270
|
+
import {
|
|
271
|
+
throttle
|
|
272
|
+
} from "../chunk-QOJGMVVR.mjs";
|
|
273
|
+
import "../chunk-424M7IR7.mjs";
|
|
261
274
|
|
|
262
275
|
// src/compat/array/chunk.ts
|
|
263
276
|
function chunk2(arr, size = 1) {
|
|
@@ -267,8 +280,166 @@ function chunk2(arr, size = 1) {
|
|
|
267
280
|
}
|
|
268
281
|
return chunk(arr, size);
|
|
269
282
|
}
|
|
283
|
+
|
|
284
|
+
// src/compat/_internal/isIndex.ts
|
|
285
|
+
var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
286
|
+
function isIndex(value) {
|
|
287
|
+
switch (typeof value) {
|
|
288
|
+
case "number": {
|
|
289
|
+
return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
290
|
+
}
|
|
291
|
+
case "symbol": {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
case "string": {
|
|
295
|
+
return IS_UNSIGNED_INTEGER.test(value);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// src/compat/_internal/toPath.ts
|
|
301
|
+
function toPath(deepKey) {
|
|
302
|
+
const ESCAPE_REGEXP = /\\(\\)?/g;
|
|
303
|
+
const PROPERTY_REGEXP = RegExp(
|
|
304
|
+
// Match anything that isn't a dot or bracket.
|
|
305
|
+
`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,
|
|
306
|
+
"g"
|
|
307
|
+
);
|
|
308
|
+
const result = [];
|
|
309
|
+
if (deepKey[0] === ".") {
|
|
310
|
+
result.push("");
|
|
311
|
+
}
|
|
312
|
+
let match;
|
|
313
|
+
let lastIndex = 0;
|
|
314
|
+
let count = 0;
|
|
315
|
+
while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {
|
|
316
|
+
let [key, expr, quote, substr] = match;
|
|
317
|
+
if (quote) {
|
|
318
|
+
key = substr.replace(ESCAPE_REGEXP, "$1");
|
|
319
|
+
} else if (expr) {
|
|
320
|
+
key = expr;
|
|
321
|
+
}
|
|
322
|
+
result.push(key);
|
|
323
|
+
if (PROPERTY_REGEXP.lastIndex === lastIndex) {
|
|
324
|
+
PROPERTY_REGEXP.lastIndex++;
|
|
325
|
+
} else {
|
|
326
|
+
lastIndex = PROPERTY_REGEXP.lastIndex;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// src/compat/object/set.ts
|
|
333
|
+
function set(obj, path, value) {
|
|
334
|
+
const resolvedPath = Array.isArray(path) ? path : typeof path === "string" ? toPath(path) : [path];
|
|
335
|
+
let current = obj;
|
|
336
|
+
for (let i = 0; i < resolvedPath.length - 1; i++) {
|
|
337
|
+
const key = resolvedPath[i];
|
|
338
|
+
const nextKey = resolvedPath[i + 1];
|
|
339
|
+
if (current[key] == null) {
|
|
340
|
+
current[key] = isIndex(nextKey) ? [] : {};
|
|
341
|
+
}
|
|
342
|
+
current = current[key];
|
|
343
|
+
}
|
|
344
|
+
const lastKey = resolvedPath[resolvedPath.length - 1];
|
|
345
|
+
current[lastKey] = value;
|
|
346
|
+
return obj;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// src/compat/array/zipObjectDeep.ts
|
|
350
|
+
function zipObjectDeep(keys, values) {
|
|
351
|
+
const result = {};
|
|
352
|
+
const zipped = zip(keys, values);
|
|
353
|
+
for (let i = 0; i < zipped.length; i++) {
|
|
354
|
+
const [key, value] = zipped[i];
|
|
355
|
+
if (key != null) {
|
|
356
|
+
set(result, key, value);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return result;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/compat/_internal/isDeepKey.ts
|
|
363
|
+
var IS_PLAIN = /^\w*$/;
|
|
364
|
+
var IS_DEEP = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
365
|
+
function isDeepKey(key) {
|
|
366
|
+
switch (typeof key) {
|
|
367
|
+
case "number":
|
|
368
|
+
case "symbol": {
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
case "string": {
|
|
372
|
+
return !IS_PLAIN.test(key) && IS_DEEP.test(key);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/compat/object/get.ts
|
|
378
|
+
function get(object, path, defaultValue) {
|
|
379
|
+
let resolvedPath;
|
|
380
|
+
if (Array.isArray(path)) {
|
|
381
|
+
resolvedPath = path;
|
|
382
|
+
} else if (typeof path === "string" && isDeepKey(path) && (object == null ? void 0 : object[path]) == null) {
|
|
383
|
+
resolvedPath = toPath(path);
|
|
384
|
+
} else {
|
|
385
|
+
resolvedPath = [path];
|
|
386
|
+
}
|
|
387
|
+
if (resolvedPath.length === 0) {
|
|
388
|
+
return defaultValue;
|
|
389
|
+
}
|
|
390
|
+
let current = object;
|
|
391
|
+
let index;
|
|
392
|
+
for (index = 0; index < resolvedPath.length && current != null; index++) {
|
|
393
|
+
let key = resolvedPath[index];
|
|
394
|
+
if (Object.is(key.valueOf(), -0)) {
|
|
395
|
+
key = "-0";
|
|
396
|
+
}
|
|
397
|
+
current = current[key];
|
|
398
|
+
}
|
|
399
|
+
if (current === null && index === resolvedPath.length) {
|
|
400
|
+
return current;
|
|
401
|
+
}
|
|
402
|
+
return current != null ? current : defaultValue;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// src/compat/string/startsWith.ts
|
|
406
|
+
var startsWith = (str, target, position = 0) => {
|
|
407
|
+
return str.startsWith(target, position);
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
// src/compat/string/endsWith.ts
|
|
411
|
+
var endsWith = (str, target, position = str.length) => {
|
|
412
|
+
return str.endsWith(target, position);
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
// src/compat/math/max.ts
|
|
416
|
+
function max(items = []) {
|
|
417
|
+
let maxElement = items[0];
|
|
418
|
+
let max2 = void 0;
|
|
419
|
+
for (const element of items) {
|
|
420
|
+
if (max2 == null || element > max2) {
|
|
421
|
+
max2 = element;
|
|
422
|
+
maxElement = element;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return maxElement;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/compat/math/min.ts
|
|
429
|
+
function min(items = []) {
|
|
430
|
+
let minElement = items[0];
|
|
431
|
+
let min2 = void 0;
|
|
432
|
+
for (const element of items) {
|
|
433
|
+
if (min2 == null || element < min2) {
|
|
434
|
+
min2 = element;
|
|
435
|
+
minElement = element;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return minElement;
|
|
439
|
+
}
|
|
270
440
|
export {
|
|
271
441
|
AbortError,
|
|
442
|
+
TimeoutError,
|
|
272
443
|
camelCase,
|
|
273
444
|
capitalize,
|
|
274
445
|
chunk2 as chunk,
|
|
@@ -285,10 +456,13 @@ export {
|
|
|
285
456
|
dropRight,
|
|
286
457
|
dropRightWhile,
|
|
287
458
|
dropWhile,
|
|
459
|
+
endsWith,
|
|
288
460
|
fill,
|
|
461
|
+
flatMap,
|
|
289
462
|
flatten,
|
|
290
463
|
flattenDeep,
|
|
291
464
|
forEachRight,
|
|
465
|
+
get,
|
|
292
466
|
groupBy,
|
|
293
467
|
head,
|
|
294
468
|
inRange,
|
|
@@ -306,9 +480,11 @@ export {
|
|
|
306
480
|
keyBy,
|
|
307
481
|
last,
|
|
308
482
|
lowerCase,
|
|
483
|
+
max,
|
|
309
484
|
maxBy,
|
|
310
485
|
mean,
|
|
311
486
|
meanBy,
|
|
487
|
+
min,
|
|
312
488
|
minBy,
|
|
313
489
|
negate,
|
|
314
490
|
noop,
|
|
@@ -325,8 +501,11 @@ export {
|
|
|
325
501
|
round,
|
|
326
502
|
sample,
|
|
327
503
|
sampleSize,
|
|
504
|
+
set,
|
|
328
505
|
shuffle,
|
|
329
506
|
snakeCase,
|
|
507
|
+
startCase,
|
|
508
|
+
startsWith,
|
|
330
509
|
sum,
|
|
331
510
|
sumBy,
|
|
332
511
|
tail,
|
|
@@ -344,12 +523,14 @@ export {
|
|
|
344
523
|
uniqWith,
|
|
345
524
|
unzip,
|
|
346
525
|
unzipWith,
|
|
526
|
+
withTimeout,
|
|
347
527
|
without,
|
|
348
528
|
xor,
|
|
349
529
|
xorBy,
|
|
350
530
|
xorWith,
|
|
351
531
|
zip,
|
|
352
532
|
zipObject,
|
|
533
|
+
zipObjectDeep,
|
|
353
534
|
zipWith
|
|
354
535
|
};
|
|
355
536
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/compat/array/chunk.ts"],"sourcesContent":["import { chunk as chunkToolkit } from '../../array/chunk.ts';\n\n/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: readonly T[], size: number = 1): T[][] {\n size = Math.max(Math.floor(size), 0);\n\n if (size === 0) {\n return [];\n }\n\n return chunkToolkit(arr, size);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,SAASA,OAAS,KAAmB,OAAe,GAAU;AACnE,SAAO,KAAK,IAAI,KAAK,MAAM,IAAI,GAAG,CAAC;AAEnC,MAAI,SAAS,GAAG;AACd,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,MAAa,KAAK,IAAI;AAC/B;","names":["chunk"]}
|
|
1
|
+
{"version":3,"sources":["../../src/compat/array/chunk.ts","../../src/compat/_internal/isIndex.ts","../../src/compat/_internal/toPath.ts","../../src/compat/object/set.ts","../../src/compat/array/zipObjectDeep.ts","../../src/compat/_internal/isDeepKey.ts","../../src/compat/object/get.ts","../../src/compat/string/startsWith.ts","../../src/compat/string/endsWith.ts","../../src/compat/math/max.ts","../../src/compat/math/min.ts"],"sourcesContent":["import { chunk as chunkToolkit } from '../../array/chunk.ts';\n\n/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: readonly T[], size: number = 1): T[][] {\n size = Math.max(Math.floor(size), 0);\n\n if (size === 0) {\n return [];\n }\n\n return chunkToolkit(arr, size);\n}\n","const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/\n\nexport function isIndex(value: PropertyKey) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}","/**\n * Converts a deep key string into an array of path segments.\n *\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @param deepKey - The deep key string to convert.\n * @returns An array of strings, each representing a segment of the path.\n *\n * Examples:\n *\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n */\nexport function toPath(deepKey: string): string[] {\n const ESCAPE_REGEXP = /\\\\(\\\\)?/g;\n const PROPERTY_REGEXP = RegExp(\n // Match anything that isn't a dot or bracket.\n \"[^.[\\\\]]+\" +\n \"|\" +\n // Or match property names within brackets.\n \"\\\\[(?:\" +\n // Match a non-string expression.\n \"([^\\\"'][^[]*)\" +\n \"|\" +\n // Or match strings (supports escaping characters).\n \"([\\\"'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2\" +\n \")\\\\]\" +\n \"|\" +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n \"(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))\",\n \"g\",\n );\n\n const result: string[] = [];\n\n if (deepKey[0] === \".\") {\n result.push(\"\");\n }\n\n let match: RegExpExecArray | null;\n let lastIndex = 0;\n let count = 0;\n\n while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {\n let [key, expr, quote, substr] = match;\n\n if (quote) {\n key = substr.replace(ESCAPE_REGEXP, \"$1\");\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n\n if (PROPERTY_REGEXP.lastIndex === lastIndex) {\n PROPERTY_REGEXP.lastIndex++;\n } else {\n lastIndex = PROPERTY_REGEXP.lastIndex;\n }\n }\n\n return result;\n}\n","import { isIndex } from \"../_internal/isIndex.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\n\n/**\n * Sets the value at the specified path of the given object. If any part of the path does not exist, it will be created.\n *\n * @template T - The type of the object.\n * @param {Settable} obj - The object to modify.\n * @param {Path} path - The path of the property to set.\n * @param {any} value - The value to set.\n * @returns {T} - The modified object.\n *\n * @example\n * // Set a value in a nested object\n * const obj = { a: { b: { c: 3 } } };\n * set(obj, 'a.b.c', 4);\n * console.log(obj.a.b.c); // 4\n *\n * @example\n * // Set a value in an array\n * const arr = [1, 2, 3];\n * set(arr, 1, 4);\n * console.log(arr[1]); // 4\n *\n * @example\n * // Create non-existent path and set value\n * const obj = {};\n * set(obj, 'a.b.c', 4);\n * console.log(obj); // { a: { b: { c: 4 } } }\n */\nexport function set<T>(obj: object, path: PropertyKey | readonly PropertyKey[], value: unknown): T;\nexport function set<T extends object>(obj: T, path: PropertyKey | readonly PropertyKey[], value: unknown): T {\n const resolvedPath = Array.isArray(path)\n ? path\n : typeof path === 'string'\n ? toPath(path)\n : [path];\n\n let current: any = obj;\n\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n\n if (current[key] == null) {\n current[key] = isIndex(nextKey) ? [] : {};\n }\n\n current = current[key];\n }\n\n const lastKey = resolvedPath[resolvedPath.length - 1];\n current[lastKey] = value;\n\n return obj;\n}\n","import { zip } from \"../../array/zip.ts\";\nimport { set } from \"../object/set.ts\";\n\n/**\n * Creates a deeply nested object given arrays of paths and values.\n *\n * This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.\n * It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.\n * Paths can be dot-separated strings or arrays of property names.\n * \n * If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.\n *\n * @template V - The type of elements in the array.\n * @param {string[] | string[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.\n * @param {V[]} values - An array of values corresponding to the property paths.\n * @returns {object} A new object composed of the given property paths and values.\n *\n * @example\n * const paths = ['a.b.c', 'd.e.f'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n *\n * @example\n * const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n * \n * @example\n * const paths = ['a.b[0].c', 'a.b[1].d'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\nexport function zipObjectDeep<P extends string | number | symbol, V>(keys: P[], values: V[]): { [K in P]: V } {\n const result = {} as { [K in P]: V };\n const zipped = zip(keys, values);\n\n for (let i = 0; i < zipped.length; i++) {\n const [key, value] = zipped[i];\n\n if (key != null) {\n set(result, key, value);\n }\n }\n\n return result;\n}\n","const IS_PLAIN = /^\\w*$/;\nconst IS_DEEP = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @param key - The key to check.\n * @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n *\n * Examples:\n *\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n */\nexport function isDeepKey(key: PropertyKey): boolean {\n switch (typeof key) {\n case \"number\":\n case \"symbol\": {\n return false;\n }\n case \"string\": {\n return !IS_PLAIN.test(key) && IS_DEEP.test(key);\n }\n }\n}\n","import { isDeepKey } from \"../_internal/isDeepKey.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\nimport type { Get } from \"./get.types.ts\";\n\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K]} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T, path: K | [K]): T[K];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T | null | undefined, path: K | [K]): T[K] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T, D>(object: T | null | undefined, path: K | [K], defaultValue: D): Exclude<T[K], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T, path: [K1, K2]): T[K1][K2];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T | null | undefined, path: [K1, K2]): T[K1][K2] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], D>(object: T | null | undefined, path: [K1, K2], defaultValue: D): Exclude<T[K1][K2], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T, path: [K1, K2, K3]): T[K1][K2][K3];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T | null | undefined, path: [K1, K2, K3]): T[K1][K2][K3] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], D>(object: T | null | undefined, path: [K1, K2, K3], defaultValue: D): Exclude<T[K1][K2][K3], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T | null | undefined, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3][K4], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], D>(object: T | null | undefined, path: [K1, K2, K3, K4], defaultValue: D): Exclude<T[K1][K2][K3][K4], undefined> | D;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T>} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T>, path: number): T;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T | undefined} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T> | null | undefined, path: number): T | undefined;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * @template D - The type of the default value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {T | D} - Returns the resolved value.\n */\nexport function get<T, D>(object: Record<number, T> | null | undefined, path: number, defaultValue: D): T | D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning the default value.\n * \n * @template D - The type of the default value.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {D} - Returns the default value.\n */\nexport function get<D>(object: null | undefined, path: PropertyKey, defaultValue: D): D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning undefined.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @returns {undefined} - Returns undefined.\n */\nexport function get(object: null | undefined, path: PropertyKey): undefined;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @returns {string extends P ? any : Get<T, P>} - Returns the resolved value.\n */\nexport function get<T, P extends string>(data: T, path: P): string extends P ? any : Get<T, P>;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * @template D - The type of the default value.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<Get<T, P>, null | undefined> | D} - Returns the resolved value.\n */\nexport function get<T, P extends string, D = Get<T, P>>(data: T, path: P, defaultValue: D): Exclude<Get<T, P>, null | undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @param {unknown} object - The object to query.\n * @param {PropertyKey | readonly PropertyKey[]} path - The path of the property to get.\n * @param {unknown} [defaultValue] - The value returned if the resolved value is undefined.\n * @returns {any} - Returns the resolved value.\n */\nexport function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaultValue?: unknown): any;\nexport function get(object: any, path: PropertyKey | readonly PropertyKey[], defaultValue?: any): any {\n let resolvedPath;\n\n if (Array.isArray(path)) {\n resolvedPath = path;\n } else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {\n resolvedPath = toPath(path);\n } else {\n resolvedPath = [path];\n }\n\n if (resolvedPath.length === 0) {\n return defaultValue;\n }\n\n let current = object;\n let index;\n\n for (index = 0; index < resolvedPath.length && current != null; index++) {\n let key = resolvedPath[index];\n\n if (Object.is(key.valueOf(), -0)) {\n key = '-0';\n }\n\n current = current[key];\n }\n\n if (current === null && index === resolvedPath.length) {\n return current;\n }\n\n return current ?? defaultValue;\n}","/**\n * Checks if a string contains another string at the beginning of the string.\n *\n * Checks if one string startsWith another string. Optional position parameter to start searching from a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional offset to start searching in the str string\n * @returns {boolean} - True if the str string starts with the target string.\n *\n * @example\n * const isPrefix = startsWith('fooBar', 'foo') // returns true\n * const isPrefix = startsWith('fooBar', 'bar') // returns false\n * const isPrefix = startsWith('fooBar', 'abc') // returns false\n * const isPrefix = startsWith('fooBar', 'Bar', 2) // returns true\n * const isPrefix = startsWith('fooBar', 'Bar', 5) // returns false\n */\nexport const startsWith = (str: string, target: string, position: number = 0): boolean => {\n return str.startsWith(target, position);\n};\n","/**\n * Checks if a string contains another string at the end of the string.\n *\n * Checks if one string endsWith another string. Optional position parameter to offset searching before a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional position from the start to search up to this index\n * @returns {boolean} - True if the str string ends with the target string.\n *\n * @example\n * const isPrefix = endsWith('fooBar', 'foo') // returns true\n * const isPrefix = endsWith('fooBar', 'bar') // returns false\n * const isPrefix = endsWith('fooBar', 'abc') // returns false\n * const isPrefix = endsWith('fooBar', 'foo', 3) // returns true\n * const isPrefix = endsWith('fooBar', 'abc', 5) // returns false\n */\nexport const endsWith = (str: string, target: string, position: number = str.length): boolean => {\n return str.endsWith(target, position);\n};\n","/**\n * Finds the element in an array that has the maximum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T} The element with the maximum value.\n * @example\n * // Returns 9\n * max([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns 8\n * max([0, -3, 2, 8, 7])\n */\nexport function max<T>(items: readonly T[] = []): T {\n let maxElement = items[0];\n let max = undefined;\n\n for (const element of items) {\n if (max == null || element > max) {\n max = element;\n maxElement = element;\n }\n }\n\n return maxElement;\n}\n","/**\n * Finds the element in an array that has the minimum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T} The element with the minimum value.\n * @example\n * // Returns 1\n * min([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns -3\n * min([0, -3, 2, 8, 7])\n */\nexport function min<T>(items: readonly T[] = []): T {\n let minElement = items[0];\n let min = undefined;\n\n for (const element of items) {\n if (min == null || element < min) {\n min = element;\n minElement = element;\n }\n }\n\n return minElement;\n}"],"mappings":"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","names":["chunk","max","min"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/error/TimeoutError.ts
|
|
21
|
+
var TimeoutError_exports = {};
|
|
22
|
+
__export(TimeoutError_exports, {
|
|
23
|
+
TimeoutError: () => TimeoutError
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(TimeoutError_exports);
|
|
26
|
+
var TimeoutError = class extends Error {
|
|
27
|
+
constructor(message = "The operation was timed out") {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "TimeoutError";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
TimeoutError
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=TimeoutError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/error/TimeoutError.ts"],"sourcesContent":["/**\n * An error class representing an timeout operation.\n * @augments Error\n */\nexport class TimeoutError extends Error {\n constructor(message = 'The operation was timed out') {\n super(message);\n this.name = 'TimeoutError';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,eAAN,cAA2B,MAAM;AAAA,EACtC,YAAY,UAAU,+BAA+B;AACnD,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/error/index.d.mts
CHANGED
package/dist/error/index.d.ts
CHANGED