es-toolkit 1.35.0 → 1.36.0-dev.1215
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 +12 -0
- package/dist/_chunk/{isPromise-ByAybB.js → isPromise-CxqI1v.js} +122 -36
- package/dist/_chunk/{reverseString-D-wK2p.js → reverseString-BixeGz.js} +84 -13
- package/dist/_chunk/toSnakeCaseKeys-DZO2eB.js +4901 -0
- package/dist/_chunk/{unary-BsNWRM.js → unary-EIEhcF.js} +46 -0
- package/dist/_chunk/{zip-_HttSl.js → zip-BJSrRi.js} +38 -57
- package/dist/array/index.js +55 -6
- package/dist/array/pullAt.d.mts +0 -2
- package/dist/array/pullAt.d.ts +0 -2
- package/dist/array/take.d.mts +1 -1
- package/dist/array/take.d.ts +1 -1
- package/dist/array/take.mjs +4 -1
- package/dist/array/takeRight.d.mts +1 -1
- package/dist/array/takeRight.d.ts +1 -1
- package/dist/array/takeRight.mjs +5 -2
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/_internal/copyArray.mjs +12 -0
- package/dist/compat/_internal/mapToEntries.mjs +11 -0
- package/dist/compat/_internal/setToEntries.mjs +11 -0
- package/dist/compat/_internal/toKey.mjs +2 -2
- package/dist/compat/array/find.mjs +3 -3
- package/dist/compat/array/findLast.mjs +2 -2
- package/dist/compat/array/flatMap.d.mts +20 -0
- package/dist/compat/array/flatMap.d.ts +20 -0
- package/dist/compat/array/flatMap.mjs +13 -0
- package/dist/compat/array/forEachRight.d.mts +106 -0
- package/dist/compat/array/forEachRight.d.ts +106 -0
- package/dist/compat/array/forEachRight.mjs +21 -0
- package/dist/compat/array/groupBy.d.mts +55 -0
- package/dist/compat/array/groupBy.d.ts +55 -0
- package/dist/compat/array/groupBy.mjs +15 -0
- package/dist/compat/array/partition.d.mts +65 -0
- package/dist/compat/array/partition.d.ts +65 -0
- package/dist/compat/array/partition.mjs +24 -0
- package/dist/compat/array/pullAllWith.d.mts +59 -0
- package/dist/compat/array/pullAllWith.d.ts +59 -0
- package/dist/compat/array/pullAllWith.mjs +33 -0
- package/dist/compat/array/pullAt.d.mts +32 -0
- package/dist/compat/array/pullAt.d.ts +32 -0
- package/dist/compat/array/pullAt.mjs +34 -0
- package/dist/compat/compat.d.mts +310 -0
- package/dist/compat/compat.d.ts +310 -0
- package/dist/compat/compat.mjs +312 -0
- package/dist/compat/function/partial.d.mts +575 -0
- package/dist/compat/function/partial.d.ts +575 -0
- package/dist/compat/function/partial.mjs +8 -0
- package/dist/compat/function/partialRight.d.mts +651 -0
- package/dist/compat/function/partialRight.d.ts +651 -0
- package/dist/compat/function/partialRight.mjs +8 -0
- package/dist/compat/index.d.mts +16 -7
- package/dist/compat/index.d.ts +16 -7
- package/dist/compat/index.js +290 -3771
- package/dist/compat/index.mjs +19 -8
- package/dist/compat/object/defaults.mjs +7 -1
- package/dist/compat/object/forIn.d.mts +58 -0
- package/dist/compat/object/forIn.d.ts +58 -0
- package/dist/compat/object/forIn.mjs +16 -0
- package/dist/compat/object/forInRight.d.mts +58 -0
- package/dist/compat/object/forInRight.d.ts +58 -0
- package/dist/compat/object/forInRight.mjs +21 -0
- package/dist/compat/object/forOwn.d.mts +54 -0
- package/dist/compat/object/forOwn.d.ts +54 -0
- package/dist/compat/object/forOwn.mjs +19 -0
- package/dist/compat/object/forOwnRight.d.mts +54 -0
- package/dist/compat/object/forOwnRight.d.ts +54 -0
- package/dist/compat/object/forOwnRight.mjs +19 -0
- package/dist/compat/object/hasIn.d.mts +40 -0
- package/dist/compat/object/hasIn.d.ts +40 -0
- package/dist/compat/object/hasIn.mjs +34 -0
- package/dist/compat/object/toPairs.mjs +7 -2
- package/dist/compat/object/toPairsIn.mjs +7 -2
- package/dist/compat/string/repeat.d.mts +1 -1
- package/dist/compat/string/repeat.d.ts +1 -1
- package/dist/compat/string/repeat.mjs +12 -2
- package/dist/compat/string/words.d.mts +1 -1
- package/dist/compat/string/words.d.ts +1 -1
- package/dist/compat/string/words.mjs +2 -1
- package/dist/compat/toolkit.d.mts +9 -0
- package/dist/compat/toolkit.d.ts +9 -0
- package/dist/compat/toolkit.mjs +10 -0
- package/dist/compat/util/overEvery.d.mts +67 -0
- package/dist/compat/util/overEvery.d.ts +67 -0
- package/dist/compat/util/overEvery.mjs +23 -0
- package/dist/compat/util/overSome.d.mts +69 -0
- package/dist/compat/util/overSome.d.ts +69 -0
- package/dist/compat/util/overSome.mjs +23 -0
- package/dist/function/index.js +3 -5
- package/dist/function/partial.d.mts +3 -3
- package/dist/function/partial.d.ts +3 -3
- package/dist/function/partial.mjs +17 -19
- package/dist/function/partialRight.d.mts +3 -3
- package/dist/function/partialRight.d.ts +3 -3
- package/dist/function/partialRight.mjs +18 -20
- package/dist/function/throttle.mjs +0 -1
- package/dist/index.js +39 -42
- package/dist/object/index.js +15 -15
- package/dist/object/toCamelCaseKeys.mjs +3 -0
- package/dist/object/toSnakeCaseKeys.mjs +3 -0
- package/dist/predicate/index.js +4 -5
- package/dist/string/index.js +7 -8
- package/package.json +1 -1
- package/dist/_chunk/isPlainObject-Xaozpc.js +0 -93
- package/dist/_chunk/partialRight-B0_CSB.js +0 -50
- package/dist/_chunk/snakeCase-BtVEeB.js +0 -75
- package/dist/_chunk/toSnakeCaseKeys-BNpS71.js +0 -569
|
@@ -0,0 +1,4901 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const zip$1 = require('./zip-BJSrRi.js');
|
|
4
|
+
const AbortError = require('./AbortError-Cg4ZQ1.js');
|
|
5
|
+
const error_index = require('../error/index.js');
|
|
6
|
+
const unary = require('./unary-EIEhcF.js');
|
|
7
|
+
const noop = require('./noop-2IwLUk.js');
|
|
8
|
+
const range$1 = require('./range-HnEIT7.js');
|
|
9
|
+
const randomInt = require('./randomInt-CF7bZK.js');
|
|
10
|
+
const isPromise = require('./isPromise-CxqI1v.js');
|
|
11
|
+
const promise_index = require('../promise/index.js');
|
|
12
|
+
const reverseString = require('./reverseString-BixeGz.js');
|
|
13
|
+
const invariant = require('./invariant-BfGFfr.js');
|
|
14
|
+
|
|
15
|
+
function clone(obj) {
|
|
16
|
+
if (isPromise.isPrimitive(obj)) {
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
if (Array.isArray(obj) ||
|
|
20
|
+
isPromise.isTypedArray(obj) ||
|
|
21
|
+
obj instanceof ArrayBuffer ||
|
|
22
|
+
(typeof SharedArrayBuffer !== 'undefined' && obj instanceof SharedArrayBuffer)) {
|
|
23
|
+
return obj.slice(0);
|
|
24
|
+
}
|
|
25
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
26
|
+
const Constructor = prototype.constructor;
|
|
27
|
+
if (obj instanceof Date || obj instanceof Map || obj instanceof Set) {
|
|
28
|
+
return new Constructor(obj);
|
|
29
|
+
}
|
|
30
|
+
if (obj instanceof RegExp) {
|
|
31
|
+
const newRegExp = new Constructor(obj);
|
|
32
|
+
newRegExp.lastIndex = obj.lastIndex;
|
|
33
|
+
return newRegExp;
|
|
34
|
+
}
|
|
35
|
+
if (obj instanceof DataView) {
|
|
36
|
+
return new Constructor(obj.buffer.slice(0));
|
|
37
|
+
}
|
|
38
|
+
if (obj instanceof Error) {
|
|
39
|
+
const newError = new Constructor(obj.message);
|
|
40
|
+
newError.stack = obj.stack;
|
|
41
|
+
newError.name = obj.name;
|
|
42
|
+
newError.cause = obj.cause;
|
|
43
|
+
return newError;
|
|
44
|
+
}
|
|
45
|
+
if (typeof File !== 'undefined' && obj instanceof File) {
|
|
46
|
+
const newFile = new Constructor([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });
|
|
47
|
+
return newFile;
|
|
48
|
+
}
|
|
49
|
+
if (typeof obj === 'object') {
|
|
50
|
+
const newObject = Object.create(prototype);
|
|
51
|
+
return Object.assign(newObject, obj);
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function cloneDeepWith$1(obj, cloneValue) {
|
|
57
|
+
return cloneDeepWithImpl(obj, undefined, obj, new Map(), cloneValue);
|
|
58
|
+
}
|
|
59
|
+
function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = new Map(), cloneValue = undefined) {
|
|
60
|
+
const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
|
|
61
|
+
if (cloned != null) {
|
|
62
|
+
return cloned;
|
|
63
|
+
}
|
|
64
|
+
if (isPromise.isPrimitive(valueToClone)) {
|
|
65
|
+
return valueToClone;
|
|
66
|
+
}
|
|
67
|
+
if (stack.has(valueToClone)) {
|
|
68
|
+
return stack.get(valueToClone);
|
|
69
|
+
}
|
|
70
|
+
if (Array.isArray(valueToClone)) {
|
|
71
|
+
const result = new Array(valueToClone.length);
|
|
72
|
+
stack.set(valueToClone, result);
|
|
73
|
+
for (let i = 0; i < valueToClone.length; i++) {
|
|
74
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
75
|
+
}
|
|
76
|
+
if (Object.hasOwn(valueToClone, 'index')) {
|
|
77
|
+
result.index = valueToClone.index;
|
|
78
|
+
}
|
|
79
|
+
if (Object.hasOwn(valueToClone, 'input')) {
|
|
80
|
+
result.input = valueToClone.input;
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
if (valueToClone instanceof Date) {
|
|
85
|
+
return new Date(valueToClone.getTime());
|
|
86
|
+
}
|
|
87
|
+
if (valueToClone instanceof RegExp) {
|
|
88
|
+
const result = new RegExp(valueToClone.source, valueToClone.flags);
|
|
89
|
+
result.lastIndex = valueToClone.lastIndex;
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
if (valueToClone instanceof Map) {
|
|
93
|
+
const result = new Map();
|
|
94
|
+
stack.set(valueToClone, result);
|
|
95
|
+
for (const [key, value] of valueToClone) {
|
|
96
|
+
result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
if (valueToClone instanceof Set) {
|
|
101
|
+
const result = new Set();
|
|
102
|
+
stack.set(valueToClone, result);
|
|
103
|
+
for (const value of valueToClone) {
|
|
104
|
+
result.add(cloneDeepWithImpl(value, undefined, objectToClone, stack, cloneValue));
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(valueToClone)) {
|
|
109
|
+
return valueToClone.subarray();
|
|
110
|
+
}
|
|
111
|
+
if (isPromise.isTypedArray(valueToClone)) {
|
|
112
|
+
const result = new (Object.getPrototypeOf(valueToClone).constructor)(valueToClone.length);
|
|
113
|
+
stack.set(valueToClone, result);
|
|
114
|
+
for (let i = 0; i < valueToClone.length; i++) {
|
|
115
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
if (valueToClone instanceof ArrayBuffer ||
|
|
120
|
+
(typeof SharedArrayBuffer !== 'undefined' && valueToClone instanceof SharedArrayBuffer)) {
|
|
121
|
+
return valueToClone.slice(0);
|
|
122
|
+
}
|
|
123
|
+
if (valueToClone instanceof DataView) {
|
|
124
|
+
const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
|
|
125
|
+
stack.set(valueToClone, result);
|
|
126
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
if (typeof File !== 'undefined' && valueToClone instanceof File) {
|
|
130
|
+
const result = new File([valueToClone], valueToClone.name, {
|
|
131
|
+
type: valueToClone.type,
|
|
132
|
+
});
|
|
133
|
+
stack.set(valueToClone, result);
|
|
134
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
if (valueToClone instanceof Blob) {
|
|
138
|
+
const result = new Blob([valueToClone], { type: valueToClone.type });
|
|
139
|
+
stack.set(valueToClone, result);
|
|
140
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
if (valueToClone instanceof Error) {
|
|
144
|
+
const result = new valueToClone.constructor();
|
|
145
|
+
stack.set(valueToClone, result);
|
|
146
|
+
result.message = valueToClone.message;
|
|
147
|
+
result.name = valueToClone.name;
|
|
148
|
+
result.stack = valueToClone.stack;
|
|
149
|
+
result.cause = valueToClone.cause;
|
|
150
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
if (typeof valueToClone === 'object' && isCloneableObject(valueToClone)) {
|
|
154
|
+
const result = Object.create(Object.getPrototypeOf(valueToClone));
|
|
155
|
+
stack.set(valueToClone, result);
|
|
156
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
return valueToClone;
|
|
160
|
+
}
|
|
161
|
+
function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
|
|
162
|
+
const keys = [...Object.keys(source), ...isPromise.getSymbols(source)];
|
|
163
|
+
for (let i = 0; i < keys.length; i++) {
|
|
164
|
+
const key = keys[i];
|
|
165
|
+
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
166
|
+
if (descriptor == null || descriptor.writable) {
|
|
167
|
+
target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function isCloneableObject(object) {
|
|
172
|
+
switch (isPromise.getTag(object)) {
|
|
173
|
+
case isPromise.argumentsTag:
|
|
174
|
+
case isPromise.arrayTag:
|
|
175
|
+
case isPromise.arrayBufferTag:
|
|
176
|
+
case isPromise.dataViewTag:
|
|
177
|
+
case isPromise.booleanTag:
|
|
178
|
+
case isPromise.dateTag:
|
|
179
|
+
case isPromise.float32ArrayTag:
|
|
180
|
+
case isPromise.float64ArrayTag:
|
|
181
|
+
case isPromise.int8ArrayTag:
|
|
182
|
+
case isPromise.int16ArrayTag:
|
|
183
|
+
case isPromise.int32ArrayTag:
|
|
184
|
+
case isPromise.mapTag:
|
|
185
|
+
case isPromise.numberTag:
|
|
186
|
+
case isPromise.objectTag:
|
|
187
|
+
case isPromise.regexpTag:
|
|
188
|
+
case isPromise.setTag:
|
|
189
|
+
case isPromise.stringTag:
|
|
190
|
+
case isPromise.symbolTag:
|
|
191
|
+
case isPromise.uint8ArrayTag:
|
|
192
|
+
case isPromise.uint8ClampedArrayTag:
|
|
193
|
+
case isPromise.uint16ArrayTag:
|
|
194
|
+
case isPromise.uint32ArrayTag: {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
default: {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function cloneDeep$1(obj) {
|
|
204
|
+
return cloneDeepWithImpl(obj, undefined, obj, new Map(), undefined);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function findKey$1(obj, predicate) {
|
|
208
|
+
const keys = Object.keys(obj);
|
|
209
|
+
return keys.find(key => predicate(obj[key], key, obj));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function flattenObject(object, { delimiter = '.' } = {}) {
|
|
213
|
+
return flattenObjectImpl(object, '', delimiter);
|
|
214
|
+
}
|
|
215
|
+
function flattenObjectImpl(object, prefix = '', delimiter = '.') {
|
|
216
|
+
const result = {};
|
|
217
|
+
const keys = Object.keys(object);
|
|
218
|
+
for (let i = 0; i < keys.length; i++) {
|
|
219
|
+
const key = keys[i];
|
|
220
|
+
const value = object[key];
|
|
221
|
+
const prefixedKey = prefix ? `${prefix}${delimiter}${key}` : key;
|
|
222
|
+
if (isPromise.isPlainObject(value) && Object.keys(value).length > 0) {
|
|
223
|
+
Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (Array.isArray(value)) {
|
|
227
|
+
Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
result[prefixedKey] = value;
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function invert(obj) {
|
|
236
|
+
const result = {};
|
|
237
|
+
const keys = Object.keys(obj);
|
|
238
|
+
for (let i = 0; i < keys.length; i++) {
|
|
239
|
+
const key = keys[i];
|
|
240
|
+
const value = obj[key];
|
|
241
|
+
result[value] = key;
|
|
242
|
+
}
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function mapKeys$1(object, getNewKey) {
|
|
247
|
+
const result = {};
|
|
248
|
+
const keys = Object.keys(object);
|
|
249
|
+
for (let i = 0; i < keys.length; i++) {
|
|
250
|
+
const key = keys[i];
|
|
251
|
+
const value = object[key];
|
|
252
|
+
result[getNewKey(value, key, object)] = value;
|
|
253
|
+
}
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function mapValues$1(object, getNewValue) {
|
|
258
|
+
const result = {};
|
|
259
|
+
const keys = Object.keys(object);
|
|
260
|
+
for (let i = 0; i < keys.length; i++) {
|
|
261
|
+
const key = keys[i];
|
|
262
|
+
const value = object[key];
|
|
263
|
+
result[key] = getNewValue(value, key, object);
|
|
264
|
+
}
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function merge$1(target, source) {
|
|
269
|
+
const sourceKeys = Object.keys(source);
|
|
270
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
271
|
+
const key = sourceKeys[i];
|
|
272
|
+
const sourceValue = source[key];
|
|
273
|
+
const targetValue = target[key];
|
|
274
|
+
if (Array.isArray(sourceValue)) {
|
|
275
|
+
if (Array.isArray(targetValue)) {
|
|
276
|
+
target[key] = merge$1(targetValue, sourceValue);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
target[key] = merge$1([], sourceValue);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else if (isPromise.isPlainObject(sourceValue)) {
|
|
283
|
+
if (isPromise.isPlainObject(targetValue)) {
|
|
284
|
+
target[key] = merge$1(targetValue, sourceValue);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
target[key] = merge$1({}, sourceValue);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
291
|
+
target[key] = sourceValue;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return target;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function isObjectLike(value) {
|
|
298
|
+
return typeof value === 'object' && value !== null;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function omitBy(obj, shouldOmit) {
|
|
302
|
+
const result = {};
|
|
303
|
+
const keys = Object.keys(obj);
|
|
304
|
+
for (let i = 0; i < keys.length; i++) {
|
|
305
|
+
const key = keys[i];
|
|
306
|
+
const value = obj[key];
|
|
307
|
+
if (!shouldOmit(value, key)) {
|
|
308
|
+
result[key] = value;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function castArray(value) {
|
|
315
|
+
if (arguments.length === 0) {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
return Array.isArray(value) ? value : [value];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function toArray$1(value) {
|
|
322
|
+
return Array.isArray(value) ? value : Array.from(value);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function isArrayLike(value) {
|
|
326
|
+
return value != null && typeof value !== 'function' && isPromise.isLength(value.length);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function chunk(arr, size = 1) {
|
|
330
|
+
size = Math.max(Math.floor(size), 0);
|
|
331
|
+
if (size === 0 || !isArrayLike(arr)) {
|
|
332
|
+
return [];
|
|
333
|
+
}
|
|
334
|
+
return zip$1.chunk(toArray$1(arr), size);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function compact(arr) {
|
|
338
|
+
if (!isArrayLike(arr)) {
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
return zip$1.compact(Array.from(arr));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function concat(...values) {
|
|
345
|
+
return zip$1.flatten(values);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function isArrayLikeObject(value) {
|
|
349
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function difference(arr, ...values) {
|
|
353
|
+
if (!isArrayLikeObject(arr)) {
|
|
354
|
+
return [];
|
|
355
|
+
}
|
|
356
|
+
const arr1 = toArray$1(arr);
|
|
357
|
+
const arr2 = [];
|
|
358
|
+
for (let i = 0; i < values.length; i++) {
|
|
359
|
+
const value = values[i];
|
|
360
|
+
if (isArrayLikeObject(value)) {
|
|
361
|
+
arr2.push(...Array.from(value));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return zip$1.difference(arr1, arr2);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function last(array) {
|
|
368
|
+
if (!isArrayLike(array)) {
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
return zip$1.last(toArray$1(array));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function flattenArrayLike(values) {
|
|
375
|
+
const result = [];
|
|
376
|
+
for (let i = 0; i < values.length; i++) {
|
|
377
|
+
const arrayLike = values[i];
|
|
378
|
+
if (!isArrayLikeObject(arrayLike)) {
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
for (let j = 0; j < arrayLike.length; j++) {
|
|
382
|
+
result.push(arrayLike[j]);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return result;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function isDeepKey(key) {
|
|
389
|
+
switch (typeof key) {
|
|
390
|
+
case 'number':
|
|
391
|
+
case 'symbol': {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
case 'string': {
|
|
395
|
+
return key.includes('.') || key.includes('[') || key.includes(']');
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function toKey(value) {
|
|
401
|
+
if (typeof value === 'string' || typeof value === 'symbol') {
|
|
402
|
+
return value;
|
|
403
|
+
}
|
|
404
|
+
if (Object.is(value?.valueOf?.(), -0)) {
|
|
405
|
+
return '-0';
|
|
406
|
+
}
|
|
407
|
+
return String(value);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function toPath(deepKey) {
|
|
411
|
+
const result = [];
|
|
412
|
+
const length = deepKey.length;
|
|
413
|
+
if (length === 0) {
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
let index = 0;
|
|
417
|
+
let key = '';
|
|
418
|
+
let quoteChar = '';
|
|
419
|
+
let bracket = false;
|
|
420
|
+
if (deepKey.charCodeAt(0) === 46) {
|
|
421
|
+
result.push('');
|
|
422
|
+
index++;
|
|
423
|
+
}
|
|
424
|
+
while (index < length) {
|
|
425
|
+
const char = deepKey[index];
|
|
426
|
+
if (quoteChar) {
|
|
427
|
+
if (char === '\\' && index + 1 < length) {
|
|
428
|
+
index++;
|
|
429
|
+
key += deepKey[index];
|
|
430
|
+
}
|
|
431
|
+
else if (char === quoteChar) {
|
|
432
|
+
quoteChar = '';
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
key += char;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
else if (bracket) {
|
|
439
|
+
if (char === '"' || char === "'") {
|
|
440
|
+
quoteChar = char;
|
|
441
|
+
}
|
|
442
|
+
else if (char === ']') {
|
|
443
|
+
bracket = false;
|
|
444
|
+
result.push(key);
|
|
445
|
+
key = '';
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
key += char;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
if (char === '[') {
|
|
453
|
+
bracket = true;
|
|
454
|
+
if (key) {
|
|
455
|
+
result.push(key);
|
|
456
|
+
key = '';
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
else if (char === '.') {
|
|
460
|
+
if (key) {
|
|
461
|
+
result.push(key);
|
|
462
|
+
key = '';
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
key += char;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
index++;
|
|
470
|
+
}
|
|
471
|
+
if (key) {
|
|
472
|
+
result.push(key);
|
|
473
|
+
}
|
|
474
|
+
return result;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function get(object, path, defaultValue) {
|
|
478
|
+
if (object == null) {
|
|
479
|
+
return defaultValue;
|
|
480
|
+
}
|
|
481
|
+
switch (typeof path) {
|
|
482
|
+
case 'string': {
|
|
483
|
+
const result = object[path];
|
|
484
|
+
if (result === undefined) {
|
|
485
|
+
if (isDeepKey(path)) {
|
|
486
|
+
return get(object, toPath(path), defaultValue);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
return defaultValue;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return result;
|
|
493
|
+
}
|
|
494
|
+
case 'number':
|
|
495
|
+
case 'symbol': {
|
|
496
|
+
if (typeof path === 'number') {
|
|
497
|
+
path = toKey(path);
|
|
498
|
+
}
|
|
499
|
+
const result = object[path];
|
|
500
|
+
if (result === undefined) {
|
|
501
|
+
return defaultValue;
|
|
502
|
+
}
|
|
503
|
+
return result;
|
|
504
|
+
}
|
|
505
|
+
default: {
|
|
506
|
+
if (Array.isArray(path)) {
|
|
507
|
+
return getWithPath(object, path, defaultValue);
|
|
508
|
+
}
|
|
509
|
+
if (Object.is(path?.valueOf(), -0)) {
|
|
510
|
+
path = '-0';
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
path = String(path);
|
|
514
|
+
}
|
|
515
|
+
const result = object[path];
|
|
516
|
+
if (result === undefined) {
|
|
517
|
+
return defaultValue;
|
|
518
|
+
}
|
|
519
|
+
return result;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function getWithPath(object, path, defaultValue) {
|
|
524
|
+
if (path.length === 0) {
|
|
525
|
+
return defaultValue;
|
|
526
|
+
}
|
|
527
|
+
let current = object;
|
|
528
|
+
for (let index = 0; index < path.length; index++) {
|
|
529
|
+
if (current == null) {
|
|
530
|
+
return defaultValue;
|
|
531
|
+
}
|
|
532
|
+
current = current[path[index]];
|
|
533
|
+
}
|
|
534
|
+
if (current === undefined) {
|
|
535
|
+
return defaultValue;
|
|
536
|
+
}
|
|
537
|
+
return current;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function property(path) {
|
|
541
|
+
return function (object) {
|
|
542
|
+
return get(object, path);
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function isObject(value) {
|
|
547
|
+
return value !== null && (typeof value === 'object' || typeof value === 'function');
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function isMatch(target, source) {
|
|
551
|
+
if (source === target) {
|
|
552
|
+
return true;
|
|
553
|
+
}
|
|
554
|
+
switch (typeof source) {
|
|
555
|
+
case 'object': {
|
|
556
|
+
if (source == null) {
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
const keys = Object.keys(source);
|
|
560
|
+
if (target == null) {
|
|
561
|
+
return keys.length === 0;
|
|
562
|
+
}
|
|
563
|
+
if (Array.isArray(source)) {
|
|
564
|
+
return isArrayMatch(target, source);
|
|
565
|
+
}
|
|
566
|
+
if (source instanceof Map) {
|
|
567
|
+
return isMapMatch(target, source);
|
|
568
|
+
}
|
|
569
|
+
if (source instanceof Set) {
|
|
570
|
+
return isSetMatch(target, source);
|
|
571
|
+
}
|
|
572
|
+
for (let i = 0; i < keys.length; i++) {
|
|
573
|
+
const key = keys[i];
|
|
574
|
+
if (!isPromise.isPrimitive(target) && !(key in target)) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
if (source[key] === undefined && target[key] !== undefined) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
if (source[key] === null && target[key] !== null) {
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
if (!isMatch(target[key], source[key])) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
case 'function': {
|
|
590
|
+
if (Object.keys(source).length > 0) {
|
|
591
|
+
return isMatch(target, { ...source });
|
|
592
|
+
}
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
default: {
|
|
596
|
+
if (!isObject(target)) {
|
|
597
|
+
return isPromise.eq(target, source);
|
|
598
|
+
}
|
|
599
|
+
return !source;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function isMapMatch(target, source) {
|
|
604
|
+
if (source.size === 0) {
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
if (!(target instanceof Map)) {
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
for (const [key, value] of source.entries()) {
|
|
611
|
+
if (!isMatch(target.get(key), value)) {
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
function isArrayMatch(target, source) {
|
|
618
|
+
if (source.length === 0) {
|
|
619
|
+
return true;
|
|
620
|
+
}
|
|
621
|
+
if (!Array.isArray(target)) {
|
|
622
|
+
return false;
|
|
623
|
+
}
|
|
624
|
+
const countedIndex = new Set();
|
|
625
|
+
for (let i = 0; i < source.length; i++) {
|
|
626
|
+
const sourceItem = source[i];
|
|
627
|
+
const index = target.findIndex((targetItem, index) => {
|
|
628
|
+
return isMatch(targetItem, sourceItem) && !countedIndex.has(index);
|
|
629
|
+
});
|
|
630
|
+
if (index === -1) {
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
countedIndex.add(index);
|
|
634
|
+
}
|
|
635
|
+
return true;
|
|
636
|
+
}
|
|
637
|
+
function isSetMatch(target, source) {
|
|
638
|
+
if (source.size === 0) {
|
|
639
|
+
return true;
|
|
640
|
+
}
|
|
641
|
+
if (!(target instanceof Set)) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
return isArrayMatch([...target], [...source]);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function matches(source) {
|
|
648
|
+
source = cloneDeep$1(source);
|
|
649
|
+
return (target) => {
|
|
650
|
+
return isMatch(target, source);
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function cloneDeepWith(obj, cloneValue) {
|
|
655
|
+
return cloneDeepWith$1(obj, (value, key, object, stack) => {
|
|
656
|
+
const cloned = cloneValue?.(value, key, object, stack);
|
|
657
|
+
if (cloned != null) {
|
|
658
|
+
return cloned;
|
|
659
|
+
}
|
|
660
|
+
if (typeof obj !== 'object') {
|
|
661
|
+
return undefined;
|
|
662
|
+
}
|
|
663
|
+
switch (Object.prototype.toString.call(obj)) {
|
|
664
|
+
case isPromise.numberTag:
|
|
665
|
+
case isPromise.stringTag:
|
|
666
|
+
case isPromise.booleanTag: {
|
|
667
|
+
const result = new obj.constructor(obj?.valueOf());
|
|
668
|
+
copyProperties(result, obj);
|
|
669
|
+
return result;
|
|
670
|
+
}
|
|
671
|
+
case isPromise.argumentsTag: {
|
|
672
|
+
const result = {};
|
|
673
|
+
copyProperties(result, obj);
|
|
674
|
+
result.length = obj.length;
|
|
675
|
+
result[Symbol.iterator] = obj[Symbol.iterator];
|
|
676
|
+
return result;
|
|
677
|
+
}
|
|
678
|
+
default: {
|
|
679
|
+
return undefined;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function cloneDeep(obj) {
|
|
686
|
+
return cloneDeepWith(obj);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
690
|
+
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
|
|
691
|
+
switch (typeof value) {
|
|
692
|
+
case 'number': {
|
|
693
|
+
return Number.isInteger(value) && value >= 0 && value < length;
|
|
694
|
+
}
|
|
695
|
+
case 'symbol': {
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
698
|
+
case 'string': {
|
|
699
|
+
return IS_UNSIGNED_INTEGER.test(value);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function isArguments(value) {
|
|
705
|
+
return value !== null && typeof value === 'object' && isPromise.getTag(value) === '[object Arguments]';
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function has(object, path) {
|
|
709
|
+
let resolvedPath;
|
|
710
|
+
if (Array.isArray(path)) {
|
|
711
|
+
resolvedPath = path;
|
|
712
|
+
}
|
|
713
|
+
else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {
|
|
714
|
+
resolvedPath = toPath(path);
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
resolvedPath = [path];
|
|
718
|
+
}
|
|
719
|
+
if (resolvedPath.length === 0) {
|
|
720
|
+
return false;
|
|
721
|
+
}
|
|
722
|
+
let current = object;
|
|
723
|
+
for (let i = 0; i < resolvedPath.length; i++) {
|
|
724
|
+
const key = resolvedPath[i];
|
|
725
|
+
if (current == null || !Object.hasOwn(current, key)) {
|
|
726
|
+
const isSparseIndex = (Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length;
|
|
727
|
+
if (!isSparseIndex) {
|
|
728
|
+
return false;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
current = current[key];
|
|
732
|
+
}
|
|
733
|
+
return true;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
function matchesProperty(property, source) {
|
|
737
|
+
switch (typeof property) {
|
|
738
|
+
case 'object': {
|
|
739
|
+
if (Object.is(property?.valueOf(), -0)) {
|
|
740
|
+
property = '-0';
|
|
741
|
+
}
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
case 'number': {
|
|
745
|
+
property = toKey(property);
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
source = cloneDeep(source);
|
|
750
|
+
return function (target) {
|
|
751
|
+
const result = get(target, property);
|
|
752
|
+
if (result === undefined) {
|
|
753
|
+
return has(target, property);
|
|
754
|
+
}
|
|
755
|
+
if (source === undefined) {
|
|
756
|
+
return result === undefined;
|
|
757
|
+
}
|
|
758
|
+
return isMatch(result, source);
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function iteratee(value) {
|
|
763
|
+
if (value == null) {
|
|
764
|
+
return unary.identity;
|
|
765
|
+
}
|
|
766
|
+
switch (typeof value) {
|
|
767
|
+
case 'function': {
|
|
768
|
+
return value;
|
|
769
|
+
}
|
|
770
|
+
case 'object': {
|
|
771
|
+
if (Array.isArray(value) && value.length === 2) {
|
|
772
|
+
return matchesProperty(value[0], value[1]);
|
|
773
|
+
}
|
|
774
|
+
return matches(value);
|
|
775
|
+
}
|
|
776
|
+
case 'string':
|
|
777
|
+
case 'symbol':
|
|
778
|
+
case 'number': {
|
|
779
|
+
return property(value);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function differenceBy(arr, ..._values) {
|
|
785
|
+
if (!isArrayLikeObject(arr)) {
|
|
786
|
+
return [];
|
|
787
|
+
}
|
|
788
|
+
const iteratee$1 = last(_values);
|
|
789
|
+
const values = flattenArrayLike(_values);
|
|
790
|
+
if (isArrayLikeObject(iteratee$1)) {
|
|
791
|
+
return zip$1.difference(Array.from(arr), values);
|
|
792
|
+
}
|
|
793
|
+
return zip$1.differenceBy(Array.from(arr), values, iteratee(iteratee$1));
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function differenceWith(array, ...values) {
|
|
797
|
+
if (!isArrayLikeObject(array)) {
|
|
798
|
+
return [];
|
|
799
|
+
}
|
|
800
|
+
const comparator = last(values);
|
|
801
|
+
const flattenedValues = flattenArrayLike(values);
|
|
802
|
+
if (typeof comparator === 'function') {
|
|
803
|
+
return zip$1.differenceWith(Array.from(array), flattenedValues, comparator);
|
|
804
|
+
}
|
|
805
|
+
return zip$1.difference(Array.from(array), flattenedValues);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function drop(collection, itemsCount = 1, guard) {
|
|
809
|
+
if (!isArrayLike(collection)) {
|
|
810
|
+
return [];
|
|
811
|
+
}
|
|
812
|
+
itemsCount = guard ? 1 : zip$1.toInteger(itemsCount);
|
|
813
|
+
return zip$1.drop(toArray$1(collection), itemsCount);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function dropRight(collection, itemsCount = 1, guard) {
|
|
817
|
+
if (!isArrayLike(collection)) {
|
|
818
|
+
return [];
|
|
819
|
+
}
|
|
820
|
+
itemsCount = guard ? 1 : zip$1.toInteger(itemsCount);
|
|
821
|
+
return zip$1.dropRight(toArray$1(collection), itemsCount);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
function dropRightWhile(arr, predicate) {
|
|
825
|
+
if (!isArrayLike(arr)) {
|
|
826
|
+
return [];
|
|
827
|
+
}
|
|
828
|
+
return dropRightWhileImpl(Array.from(arr), predicate);
|
|
829
|
+
}
|
|
830
|
+
function dropRightWhileImpl(arr, predicate) {
|
|
831
|
+
switch (typeof predicate) {
|
|
832
|
+
case 'function': {
|
|
833
|
+
return zip$1.dropRightWhile(arr, (item, index, arr) => Boolean(predicate(item, index, arr)));
|
|
834
|
+
}
|
|
835
|
+
case 'object': {
|
|
836
|
+
if (Array.isArray(predicate) && predicate.length === 2) {
|
|
837
|
+
const key = predicate[0];
|
|
838
|
+
const value = predicate[1];
|
|
839
|
+
return zip$1.dropRightWhile(arr, matchesProperty(key, value));
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
return zip$1.dropRightWhile(arr, matches(predicate));
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
case 'symbol':
|
|
846
|
+
case 'number':
|
|
847
|
+
case 'string': {
|
|
848
|
+
return zip$1.dropRightWhile(arr, property(predicate));
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function dropWhile(arr, predicate) {
|
|
854
|
+
if (!isArrayLike(arr)) {
|
|
855
|
+
return [];
|
|
856
|
+
}
|
|
857
|
+
return dropWhileImpl(toArray$1(arr), predicate);
|
|
858
|
+
}
|
|
859
|
+
function dropWhileImpl(arr, predicate) {
|
|
860
|
+
switch (typeof predicate) {
|
|
861
|
+
case 'function': {
|
|
862
|
+
return zip$1.dropWhile(arr, (item, index, arr) => Boolean(predicate(item, index, arr)));
|
|
863
|
+
}
|
|
864
|
+
case 'object': {
|
|
865
|
+
if (Array.isArray(predicate) && predicate.length === 2) {
|
|
866
|
+
const key = predicate[0];
|
|
867
|
+
const value = predicate[1];
|
|
868
|
+
return zip$1.dropWhile(arr, matchesProperty(key, value));
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
return zip$1.dropWhile(arr, matches(predicate));
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
case 'number':
|
|
875
|
+
case 'symbol':
|
|
876
|
+
case 'string': {
|
|
877
|
+
return zip$1.dropWhile(arr, property(predicate));
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
function isIterateeCall(value, index, object) {
|
|
883
|
+
if (!isObject(object)) {
|
|
884
|
+
return false;
|
|
885
|
+
}
|
|
886
|
+
if ((typeof index === 'number' && isArrayLike(object) && isIndex(index) && index < object.length) ||
|
|
887
|
+
(typeof index === 'string' && index in object)) {
|
|
888
|
+
return isPromise.eq(object[index], value);
|
|
889
|
+
}
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function every(source, doesMatch, guard) {
|
|
894
|
+
if (!source) {
|
|
895
|
+
return true;
|
|
896
|
+
}
|
|
897
|
+
const values = Array.isArray(source) ? source : Object.values(source);
|
|
898
|
+
if (guard && isIterateeCall(source, doesMatch, guard)) {
|
|
899
|
+
doesMatch = undefined;
|
|
900
|
+
}
|
|
901
|
+
if (!doesMatch) {
|
|
902
|
+
doesMatch = unary.identity;
|
|
903
|
+
}
|
|
904
|
+
switch (typeof doesMatch) {
|
|
905
|
+
case 'function': {
|
|
906
|
+
if (!Array.isArray(source)) {
|
|
907
|
+
const keys = Object.keys(source);
|
|
908
|
+
for (let i = 0; i < keys.length; i++) {
|
|
909
|
+
const key = keys[i];
|
|
910
|
+
const value = source[key];
|
|
911
|
+
if (!doesMatch(value, key, source)) {
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
917
|
+
return values.every(doesMatch);
|
|
918
|
+
}
|
|
919
|
+
case 'object': {
|
|
920
|
+
if (Array.isArray(doesMatch) && doesMatch.length === 2) {
|
|
921
|
+
const key = doesMatch[0];
|
|
922
|
+
const value = doesMatch[1];
|
|
923
|
+
return values.every(matchesProperty(key, value));
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
return values.every(matches(doesMatch));
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
case 'symbol':
|
|
930
|
+
case 'number':
|
|
931
|
+
case 'string': {
|
|
932
|
+
return values.every(property(doesMatch));
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function isString(value) {
|
|
938
|
+
return typeof value === 'string' || value instanceof String;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function fill(array, value, start = 0, end = array ? array.length : 0) {
|
|
942
|
+
if (!isArrayLike(array)) {
|
|
943
|
+
return [];
|
|
944
|
+
}
|
|
945
|
+
if (isString(array)) {
|
|
946
|
+
return array;
|
|
947
|
+
}
|
|
948
|
+
start = Math.floor(start);
|
|
949
|
+
end = Math.floor(end);
|
|
950
|
+
if (!start) {
|
|
951
|
+
start = 0;
|
|
952
|
+
}
|
|
953
|
+
if (!end) {
|
|
954
|
+
end = 0;
|
|
955
|
+
}
|
|
956
|
+
return zip$1.fill(array, value, start, end);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function isArray(value) {
|
|
960
|
+
return Array.isArray(value);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function filter(source, predicate) {
|
|
964
|
+
if (!source) {
|
|
965
|
+
return [];
|
|
966
|
+
}
|
|
967
|
+
const collection = isArray(source) ? source : Object.values(source);
|
|
968
|
+
predicate = iteratee(predicate);
|
|
969
|
+
if (!Array.isArray(source)) {
|
|
970
|
+
const result = [];
|
|
971
|
+
const keys = Object.keys(source);
|
|
972
|
+
const length = isArrayLike(source) ? source.length : keys.length;
|
|
973
|
+
for (let i = 0; i < length; i++) {
|
|
974
|
+
const key = keys[i];
|
|
975
|
+
const value = source[key];
|
|
976
|
+
if (predicate(value, key, source)) {
|
|
977
|
+
result.push(value);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return result;
|
|
981
|
+
}
|
|
982
|
+
return collection.filter(predicate);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
function find(source, _doesMatch, fromIndex = 0) {
|
|
986
|
+
if (!source) {
|
|
987
|
+
return undefined;
|
|
988
|
+
}
|
|
989
|
+
if (fromIndex < 0) {
|
|
990
|
+
fromIndex = Math.max(source.length + fromIndex, 0);
|
|
991
|
+
}
|
|
992
|
+
const doesMatch = iteratee(_doesMatch);
|
|
993
|
+
if (typeof doesMatch === 'function' && !Array.isArray(source)) {
|
|
994
|
+
const keys = Object.keys(source);
|
|
995
|
+
for (let i = fromIndex; i < keys.length; i++) {
|
|
996
|
+
const key = keys[i];
|
|
997
|
+
const value = source[key];
|
|
998
|
+
if (doesMatch(value, key, source)) {
|
|
999
|
+
return value;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return undefined;
|
|
1003
|
+
}
|
|
1004
|
+
const values = Array.isArray(source) ? source.slice(fromIndex) : Object.values(source).slice(fromIndex);
|
|
1005
|
+
return values.find(doesMatch);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
function findIndex(arr, doesMatch, fromIndex = 0) {
|
|
1009
|
+
if (!arr) {
|
|
1010
|
+
return -1;
|
|
1011
|
+
}
|
|
1012
|
+
if (fromIndex < 0) {
|
|
1013
|
+
fromIndex = Math.max(arr.length + fromIndex, 0);
|
|
1014
|
+
}
|
|
1015
|
+
const subArray = Array.from(arr).slice(fromIndex);
|
|
1016
|
+
let index = -1;
|
|
1017
|
+
switch (typeof doesMatch) {
|
|
1018
|
+
case 'function': {
|
|
1019
|
+
index = subArray.findIndex(doesMatch);
|
|
1020
|
+
break;
|
|
1021
|
+
}
|
|
1022
|
+
case 'object': {
|
|
1023
|
+
if (Array.isArray(doesMatch) && doesMatch.length === 2) {
|
|
1024
|
+
const key = doesMatch[0];
|
|
1025
|
+
const value = doesMatch[1];
|
|
1026
|
+
index = subArray.findIndex(matchesProperty(key, value));
|
|
1027
|
+
}
|
|
1028
|
+
else {
|
|
1029
|
+
index = subArray.findIndex(matches(doesMatch));
|
|
1030
|
+
}
|
|
1031
|
+
break;
|
|
1032
|
+
}
|
|
1033
|
+
case 'number':
|
|
1034
|
+
case 'symbol':
|
|
1035
|
+
case 'string': {
|
|
1036
|
+
index = subArray.findIndex(property(doesMatch));
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return index === -1 ? -1 : index + fromIndex;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function findLast(source, _doesMatch, fromIndex) {
|
|
1043
|
+
if (!source) {
|
|
1044
|
+
return undefined;
|
|
1045
|
+
}
|
|
1046
|
+
const length = Array.isArray(source) ? source.length : Object.keys(source).length;
|
|
1047
|
+
fromIndex = zip$1.toInteger(fromIndex ?? length - 1);
|
|
1048
|
+
if (fromIndex < 0) {
|
|
1049
|
+
fromIndex = Math.max(length + fromIndex, 0);
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
fromIndex = Math.min(fromIndex, length - 1);
|
|
1053
|
+
}
|
|
1054
|
+
const doesMatch = iteratee(_doesMatch);
|
|
1055
|
+
if (typeof doesMatch === 'function' && !Array.isArray(source)) {
|
|
1056
|
+
const keys = Object.keys(source);
|
|
1057
|
+
for (let i = fromIndex; i >= 0; i--) {
|
|
1058
|
+
const key = keys[i];
|
|
1059
|
+
const value = source[key];
|
|
1060
|
+
if (doesMatch(value, key, source)) {
|
|
1061
|
+
return value;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
return undefined;
|
|
1065
|
+
}
|
|
1066
|
+
const values = Array.isArray(source) ? source.slice(0, fromIndex + 1) : Object.values(source).slice(0, fromIndex + 1);
|
|
1067
|
+
return values.findLast(doesMatch);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
function findLastIndex(arr, doesMatch, fromIndex = arr ? arr.length - 1 : 0) {
|
|
1071
|
+
if (!arr) {
|
|
1072
|
+
return -1;
|
|
1073
|
+
}
|
|
1074
|
+
if (fromIndex < 0) {
|
|
1075
|
+
fromIndex = Math.max(arr.length + fromIndex, 0);
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
fromIndex = Math.min(fromIndex, arr.length - 1);
|
|
1079
|
+
}
|
|
1080
|
+
const subArray = toArray$1(arr).slice(0, fromIndex + 1);
|
|
1081
|
+
switch (typeof doesMatch) {
|
|
1082
|
+
case 'function': {
|
|
1083
|
+
return subArray.findLastIndex(doesMatch);
|
|
1084
|
+
}
|
|
1085
|
+
case 'object': {
|
|
1086
|
+
if (Array.isArray(doesMatch) && doesMatch.length === 2) {
|
|
1087
|
+
const key = doesMatch[0];
|
|
1088
|
+
const value = doesMatch[1];
|
|
1089
|
+
return subArray.findLastIndex(matchesProperty(key, value));
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
return subArray.findLastIndex(matches(doesMatch));
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
case 'number':
|
|
1096
|
+
case 'symbol':
|
|
1097
|
+
case 'string': {
|
|
1098
|
+
return subArray.findLastIndex(property(doesMatch));
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
function flatten(value, depth = 1) {
|
|
1104
|
+
const result = [];
|
|
1105
|
+
const flooredDepth = Math.floor(depth);
|
|
1106
|
+
if (!isArrayLike(value)) {
|
|
1107
|
+
return result;
|
|
1108
|
+
}
|
|
1109
|
+
const recursive = (arr, currentDepth) => {
|
|
1110
|
+
for (let i = 0; i < arr.length; i++) {
|
|
1111
|
+
const item = arr[i];
|
|
1112
|
+
if (currentDepth < flooredDepth &&
|
|
1113
|
+
(Array.isArray(item) ||
|
|
1114
|
+
Boolean(item?.[Symbol.isConcatSpreadable]) ||
|
|
1115
|
+
(item !== null && typeof item === 'object' && Object.prototype.toString.call(item) === '[object Arguments]'))) {
|
|
1116
|
+
if (Array.isArray(item)) {
|
|
1117
|
+
recursive(item, currentDepth + 1);
|
|
1118
|
+
}
|
|
1119
|
+
else {
|
|
1120
|
+
recursive(Array.from(item), currentDepth + 1);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
else {
|
|
1124
|
+
result.push(item);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
recursive(Array.from(value), 0);
|
|
1129
|
+
return result;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function map(collection, _iteratee) {
|
|
1133
|
+
if (!collection) {
|
|
1134
|
+
return [];
|
|
1135
|
+
}
|
|
1136
|
+
const keys = isArrayLike(collection) || Array.isArray(collection) ? range$1.range(0, collection.length) : Object.keys(collection);
|
|
1137
|
+
const iteratee$1 = iteratee(_iteratee ?? unary.identity);
|
|
1138
|
+
const result = new Array(keys.length);
|
|
1139
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1140
|
+
const key = keys[i];
|
|
1141
|
+
const value = collection[key];
|
|
1142
|
+
result[i] = iteratee$1(value, key, collection);
|
|
1143
|
+
}
|
|
1144
|
+
return result;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
function flatMap(collection, iteratee) {
|
|
1148
|
+
if (isPromise.isNil(collection)) {
|
|
1149
|
+
return [];
|
|
1150
|
+
}
|
|
1151
|
+
const mapped = isPromise.isNil(iteratee) ? map(collection) : map(collection, iteratee);
|
|
1152
|
+
return flatten(mapped, 1);
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
function flattenDeep(value) {
|
|
1156
|
+
return flatten(value, Infinity);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function flattenDepth(value, depth = 1) {
|
|
1160
|
+
return flatten(value, depth);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
function forEach(collection, callback = unary.identity) {
|
|
1164
|
+
if (!collection) {
|
|
1165
|
+
return collection;
|
|
1166
|
+
}
|
|
1167
|
+
const keys = isArrayLike(collection) || Array.isArray(collection) ? range$1.range(0, collection.length) : Object.keys(collection);
|
|
1168
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1169
|
+
const key = keys[i];
|
|
1170
|
+
const value = collection[key];
|
|
1171
|
+
const result = callback(value, key, collection);
|
|
1172
|
+
if (result === false) {
|
|
1173
|
+
break;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return collection;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
function forEachRight(collection, callback = unary.identity) {
|
|
1180
|
+
if (!collection) {
|
|
1181
|
+
return collection;
|
|
1182
|
+
}
|
|
1183
|
+
const keys = isArrayLike(collection) ? range$1.range(0, collection.length) : Object.keys(collection);
|
|
1184
|
+
for (let i = keys.length - 1; i >= 0; i--) {
|
|
1185
|
+
const key = keys[i];
|
|
1186
|
+
const value = collection[key];
|
|
1187
|
+
const result = callback(value, key, collection);
|
|
1188
|
+
if (result === false) {
|
|
1189
|
+
break;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
return collection;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
function groupBy(source, _getKeyFromItem) {
|
|
1196
|
+
if (source == null) {
|
|
1197
|
+
return {};
|
|
1198
|
+
}
|
|
1199
|
+
const items = isArrayLike(source) ? Array.from(source) : Object.values(source);
|
|
1200
|
+
const getKeyFromItem = iteratee(_getKeyFromItem ?? unary.identity);
|
|
1201
|
+
return zip$1.groupBy(items, getKeyFromItem);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function head(arr) {
|
|
1205
|
+
if (!isArrayLike(arr)) {
|
|
1206
|
+
return undefined;
|
|
1207
|
+
}
|
|
1208
|
+
return zip$1.head(toArray$1(arr));
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
function includes(source, target, fromIndex, guard) {
|
|
1212
|
+
if (source == null) {
|
|
1213
|
+
return false;
|
|
1214
|
+
}
|
|
1215
|
+
if (guard || !fromIndex) {
|
|
1216
|
+
fromIndex = 0;
|
|
1217
|
+
}
|
|
1218
|
+
else {
|
|
1219
|
+
fromIndex = zip$1.toInteger(fromIndex);
|
|
1220
|
+
}
|
|
1221
|
+
if (isString(source)) {
|
|
1222
|
+
if (fromIndex > source.length || target instanceof RegExp) {
|
|
1223
|
+
return false;
|
|
1224
|
+
}
|
|
1225
|
+
if (fromIndex < 0) {
|
|
1226
|
+
fromIndex = Math.max(0, source.length + fromIndex);
|
|
1227
|
+
}
|
|
1228
|
+
return source.includes(target, fromIndex);
|
|
1229
|
+
}
|
|
1230
|
+
if (Array.isArray(source)) {
|
|
1231
|
+
return source.includes(target, fromIndex);
|
|
1232
|
+
}
|
|
1233
|
+
const keys = Object.keys(source);
|
|
1234
|
+
if (fromIndex < 0) {
|
|
1235
|
+
fromIndex = Math.max(0, keys.length + fromIndex);
|
|
1236
|
+
}
|
|
1237
|
+
for (let i = fromIndex; i < keys.length; i++) {
|
|
1238
|
+
const value = Reflect.get(source, keys[i]);
|
|
1239
|
+
if (isPromise.eq(value, target)) {
|
|
1240
|
+
return true;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
function indexOf(array, searchElement, fromIndex) {
|
|
1247
|
+
if (!isArrayLike(array)) {
|
|
1248
|
+
return -1;
|
|
1249
|
+
}
|
|
1250
|
+
if (Number.isNaN(searchElement)) {
|
|
1251
|
+
fromIndex = fromIndex ?? 0;
|
|
1252
|
+
if (fromIndex < 0) {
|
|
1253
|
+
fromIndex = Math.max(0, array.length + fromIndex);
|
|
1254
|
+
}
|
|
1255
|
+
for (let i = fromIndex; i < array.length; i++) {
|
|
1256
|
+
if (Number.isNaN(array[i])) {
|
|
1257
|
+
return i;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
return -1;
|
|
1261
|
+
}
|
|
1262
|
+
return Array.from(array).indexOf(searchElement, fromIndex);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
function intersection(...arrays) {
|
|
1266
|
+
if (arrays.length === 0) {
|
|
1267
|
+
return [];
|
|
1268
|
+
}
|
|
1269
|
+
if (!isArrayLikeObject(arrays[0])) {
|
|
1270
|
+
return [];
|
|
1271
|
+
}
|
|
1272
|
+
let result = zip$1.uniq(Array.from(arrays[0]));
|
|
1273
|
+
for (let i = 1; i < arrays.length; i++) {
|
|
1274
|
+
const array = arrays[i];
|
|
1275
|
+
if (!isArrayLikeObject(array)) {
|
|
1276
|
+
return [];
|
|
1277
|
+
}
|
|
1278
|
+
result = zip$1.intersection(result, Array.from(array));
|
|
1279
|
+
}
|
|
1280
|
+
return result;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
function intersectionBy(array, ...values) {
|
|
1284
|
+
if (!isArrayLikeObject(array)) {
|
|
1285
|
+
return [];
|
|
1286
|
+
}
|
|
1287
|
+
const lastValue = zip$1.last(values);
|
|
1288
|
+
if (lastValue === undefined) {
|
|
1289
|
+
return Array.from(array);
|
|
1290
|
+
}
|
|
1291
|
+
let result = zip$1.uniq(Array.from(array));
|
|
1292
|
+
const count = isArrayLikeObject(lastValue) ? values.length : values.length - 1;
|
|
1293
|
+
for (let i = 0; i < count; ++i) {
|
|
1294
|
+
const value = values[i];
|
|
1295
|
+
if (!isArrayLikeObject(value)) {
|
|
1296
|
+
return [];
|
|
1297
|
+
}
|
|
1298
|
+
if (isArrayLikeObject(lastValue)) {
|
|
1299
|
+
result = zip$1.intersectionBy(result, Array.from(value), unary.identity);
|
|
1300
|
+
}
|
|
1301
|
+
else if (typeof lastValue === 'function') {
|
|
1302
|
+
result = zip$1.intersectionBy(result, Array.from(value), value => lastValue(value));
|
|
1303
|
+
}
|
|
1304
|
+
else if (typeof lastValue === 'string') {
|
|
1305
|
+
result = zip$1.intersectionBy(result, Array.from(value), property(lastValue));
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return result;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
function uniq(arr) {
|
|
1312
|
+
if (!isArrayLike(arr)) {
|
|
1313
|
+
return [];
|
|
1314
|
+
}
|
|
1315
|
+
return zip$1.uniq(Array.from(arr));
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
function intersectionWith(firstArr, ...otherArrs) {
|
|
1319
|
+
if (firstArr == null) {
|
|
1320
|
+
return [];
|
|
1321
|
+
}
|
|
1322
|
+
const _comparator = last(otherArrs);
|
|
1323
|
+
let comparator = isPromise.eq;
|
|
1324
|
+
let uniq$1 = uniq;
|
|
1325
|
+
if (typeof _comparator === 'function') {
|
|
1326
|
+
comparator = _comparator;
|
|
1327
|
+
uniq$1 = uniqPreserve0;
|
|
1328
|
+
otherArrs.pop();
|
|
1329
|
+
}
|
|
1330
|
+
let result = uniq$1(Array.from(firstArr));
|
|
1331
|
+
for (let i = 0; i < otherArrs.length; ++i) {
|
|
1332
|
+
const otherArr = otherArrs[i];
|
|
1333
|
+
if (otherArr == null) {
|
|
1334
|
+
return [];
|
|
1335
|
+
}
|
|
1336
|
+
result = zip$1.intersectionWith(result, Array.from(otherArr), comparator);
|
|
1337
|
+
}
|
|
1338
|
+
return result;
|
|
1339
|
+
}
|
|
1340
|
+
function uniqPreserve0(arr) {
|
|
1341
|
+
const result = [];
|
|
1342
|
+
const added = new Set();
|
|
1343
|
+
for (let i = 0; i < arr.length; i++) {
|
|
1344
|
+
const item = arr[i];
|
|
1345
|
+
if (added.has(item)) {
|
|
1346
|
+
continue;
|
|
1347
|
+
}
|
|
1348
|
+
result.push(item);
|
|
1349
|
+
added.add(item);
|
|
1350
|
+
}
|
|
1351
|
+
return result;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
function join(array, separator = ',') {
|
|
1355
|
+
if (!isArrayLike(array)) {
|
|
1356
|
+
return '';
|
|
1357
|
+
}
|
|
1358
|
+
return Array.from(array).join(separator);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
function lastIndexOf(array, searchElement, fromIndex) {
|
|
1362
|
+
if (!isArrayLike(array) || array.length === 0) {
|
|
1363
|
+
return -1;
|
|
1364
|
+
}
|
|
1365
|
+
const length = array.length;
|
|
1366
|
+
let index = fromIndex ?? length - 1;
|
|
1367
|
+
if (fromIndex != null) {
|
|
1368
|
+
index = index < 0 ? Math.max(length + index, 0) : Math.min(index, length - 1);
|
|
1369
|
+
}
|
|
1370
|
+
if (Number.isNaN(searchElement)) {
|
|
1371
|
+
for (let i = index; i >= 0; i--) {
|
|
1372
|
+
if (Number.isNaN(array[i])) {
|
|
1373
|
+
return i;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
return Array.from(array).lastIndexOf(searchElement, index);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
function nth(array, n = 0) {
|
|
1381
|
+
if (!isArrayLikeObject(array) || array.length === 0) {
|
|
1382
|
+
return undefined;
|
|
1383
|
+
}
|
|
1384
|
+
n = zip$1.toInteger(n);
|
|
1385
|
+
if (n < 0) {
|
|
1386
|
+
n += array.length;
|
|
1387
|
+
}
|
|
1388
|
+
return array[n];
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
function getPriority(a) {
|
|
1392
|
+
if (typeof a === 'symbol') {
|
|
1393
|
+
return 1;
|
|
1394
|
+
}
|
|
1395
|
+
if (a === null) {
|
|
1396
|
+
return 2;
|
|
1397
|
+
}
|
|
1398
|
+
if (a === undefined) {
|
|
1399
|
+
return 3;
|
|
1400
|
+
}
|
|
1401
|
+
if (a !== a) {
|
|
1402
|
+
return 4;
|
|
1403
|
+
}
|
|
1404
|
+
return 0;
|
|
1405
|
+
}
|
|
1406
|
+
const compareValues = (a, b, order) => {
|
|
1407
|
+
if (a !== b) {
|
|
1408
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
1409
|
+
return order === 'desc' ? b.localeCompare(a) : a.localeCompare(b);
|
|
1410
|
+
}
|
|
1411
|
+
const aPriority = getPriority(a);
|
|
1412
|
+
const bPriority = getPriority(b);
|
|
1413
|
+
if (aPriority === bPriority && aPriority === 0) {
|
|
1414
|
+
if (a < b) {
|
|
1415
|
+
return order === 'desc' ? 1 : -1;
|
|
1416
|
+
}
|
|
1417
|
+
if (a > b) {
|
|
1418
|
+
return order === 'desc' ? -1 : 1;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
return order === 'desc' ? bPriority - aPriority : aPriority - bPriority;
|
|
1422
|
+
}
|
|
1423
|
+
return 0;
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
1427
|
+
const regexIsPlainProp = /^\w*$/;
|
|
1428
|
+
function isKey(value, object) {
|
|
1429
|
+
if (Array.isArray(value)) {
|
|
1430
|
+
return false;
|
|
1431
|
+
}
|
|
1432
|
+
if (typeof value === 'number' || typeof value === 'boolean' || value == null || zip$1.isSymbol(value)) {
|
|
1433
|
+
return true;
|
|
1434
|
+
}
|
|
1435
|
+
return ((typeof value === 'string' && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value))) ||
|
|
1436
|
+
(object != null && Object.hasOwn(object, value)));
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
function orderBy(collection, criteria, orders, guard) {
|
|
1440
|
+
if (collection == null) {
|
|
1441
|
+
return [];
|
|
1442
|
+
}
|
|
1443
|
+
orders = guard ? undefined : orders;
|
|
1444
|
+
if (!Array.isArray(collection)) {
|
|
1445
|
+
collection = Object.values(collection);
|
|
1446
|
+
}
|
|
1447
|
+
if (!Array.isArray(criteria)) {
|
|
1448
|
+
criteria = criteria == null ? [null] : [criteria];
|
|
1449
|
+
}
|
|
1450
|
+
if (criteria.length === 0) {
|
|
1451
|
+
criteria = [null];
|
|
1452
|
+
}
|
|
1453
|
+
if (!Array.isArray(orders)) {
|
|
1454
|
+
orders = orders == null ? [] : [orders];
|
|
1455
|
+
}
|
|
1456
|
+
orders = orders.map(order => String(order));
|
|
1457
|
+
const getValueByNestedPath = (object, path) => {
|
|
1458
|
+
let target = object;
|
|
1459
|
+
for (let i = 0; i < path.length && target != null; ++i) {
|
|
1460
|
+
target = target[path[i]];
|
|
1461
|
+
}
|
|
1462
|
+
return target;
|
|
1463
|
+
};
|
|
1464
|
+
const getValueByCriterion = (criterion, object) => {
|
|
1465
|
+
if (object == null || criterion == null) {
|
|
1466
|
+
return object;
|
|
1467
|
+
}
|
|
1468
|
+
if (typeof criterion === 'object' && 'key' in criterion) {
|
|
1469
|
+
if (Object.hasOwn(object, criterion.key)) {
|
|
1470
|
+
return object[criterion.key];
|
|
1471
|
+
}
|
|
1472
|
+
return getValueByNestedPath(object, criterion.path);
|
|
1473
|
+
}
|
|
1474
|
+
if (typeof criterion === 'function') {
|
|
1475
|
+
return criterion(object);
|
|
1476
|
+
}
|
|
1477
|
+
if (Array.isArray(criterion)) {
|
|
1478
|
+
return getValueByNestedPath(object, criterion);
|
|
1479
|
+
}
|
|
1480
|
+
if (typeof object === 'object') {
|
|
1481
|
+
return object[criterion];
|
|
1482
|
+
}
|
|
1483
|
+
return object;
|
|
1484
|
+
};
|
|
1485
|
+
const preparedCriteria = criteria.map(criterion => {
|
|
1486
|
+
if (Array.isArray(criterion) && criterion.length === 1) {
|
|
1487
|
+
criterion = criterion[0];
|
|
1488
|
+
}
|
|
1489
|
+
if (criterion == null || typeof criterion === 'function' || Array.isArray(criterion) || isKey(criterion)) {
|
|
1490
|
+
return criterion;
|
|
1491
|
+
}
|
|
1492
|
+
return { key: criterion, path: toPath(criterion) };
|
|
1493
|
+
});
|
|
1494
|
+
const preparedCollection = collection.map(item => ({
|
|
1495
|
+
original: item,
|
|
1496
|
+
criteria: preparedCriteria.map(criterion => getValueByCriterion(criterion, item)),
|
|
1497
|
+
}));
|
|
1498
|
+
return preparedCollection
|
|
1499
|
+
.slice()
|
|
1500
|
+
.sort((a, b) => {
|
|
1501
|
+
for (let i = 0; i < preparedCriteria.length; i++) {
|
|
1502
|
+
const comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]);
|
|
1503
|
+
if (comparedResult !== 0) {
|
|
1504
|
+
return comparedResult;
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
return 0;
|
|
1508
|
+
})
|
|
1509
|
+
.map(item => item.original);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
function partition(source, predicate) {
|
|
1513
|
+
if (!source) {
|
|
1514
|
+
return [[], []];
|
|
1515
|
+
}
|
|
1516
|
+
const collection = isArrayLike(source) ? source : Object.values(source);
|
|
1517
|
+
predicate = iteratee(predicate);
|
|
1518
|
+
const matched = [];
|
|
1519
|
+
const unmatched = [];
|
|
1520
|
+
for (let i = 0; i < collection.length; i++) {
|
|
1521
|
+
const value = collection[i];
|
|
1522
|
+
if (predicate(value)) {
|
|
1523
|
+
matched.push(value);
|
|
1524
|
+
}
|
|
1525
|
+
else {
|
|
1526
|
+
unmatched.push(value);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
return [matched, unmatched];
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
function pull(arr, ...valuesToRemove) {
|
|
1533
|
+
return zip$1.pull(arr, valuesToRemove);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
function pullAll(arr, valuesToRemove = []) {
|
|
1537
|
+
return zip$1.pull(arr, Array.from(valuesToRemove));
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
function pullAllBy(arr, valuesToRemove, _getValue) {
|
|
1541
|
+
const getValue = iteratee(_getValue);
|
|
1542
|
+
const valuesSet = new Set(Array.from(valuesToRemove).map(x => getValue(x)));
|
|
1543
|
+
let resultIndex = 0;
|
|
1544
|
+
for (let i = 0; i < arr.length; i++) {
|
|
1545
|
+
const value = getValue(arr[i]);
|
|
1546
|
+
if (valuesSet.has(value)) {
|
|
1547
|
+
continue;
|
|
1548
|
+
}
|
|
1549
|
+
if (!Object.hasOwn(arr, i)) {
|
|
1550
|
+
delete arr[resultIndex++];
|
|
1551
|
+
continue;
|
|
1552
|
+
}
|
|
1553
|
+
arr[resultIndex++] = arr[i];
|
|
1554
|
+
}
|
|
1555
|
+
arr.length = resultIndex;
|
|
1556
|
+
return arr;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
function copyArray(source, array) {
|
|
1560
|
+
const length = source.length;
|
|
1561
|
+
if (array == null) {
|
|
1562
|
+
array = Array(length);
|
|
1563
|
+
}
|
|
1564
|
+
for (let i = 0; i < length; i++) {
|
|
1565
|
+
array[i] = source[i];
|
|
1566
|
+
}
|
|
1567
|
+
return array;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
function pullAllWith(array, values, comparator) {
|
|
1571
|
+
if (array?.length == null || values?.length == null) {
|
|
1572
|
+
return array;
|
|
1573
|
+
}
|
|
1574
|
+
if (array === values) {
|
|
1575
|
+
values = copyArray(values);
|
|
1576
|
+
}
|
|
1577
|
+
let resultLength = 0;
|
|
1578
|
+
if (comparator == null) {
|
|
1579
|
+
comparator = (a, b) => isPromise.eq(a, b);
|
|
1580
|
+
}
|
|
1581
|
+
const valuesArray = Array.isArray(values) ? values : Array.from(values);
|
|
1582
|
+
const hasUndefined = valuesArray.includes(undefined);
|
|
1583
|
+
for (let i = 0; i < array.length; i++) {
|
|
1584
|
+
if (i in array) {
|
|
1585
|
+
const shouldRemove = valuesArray.some(value => comparator(array[i], value));
|
|
1586
|
+
if (!shouldRemove) {
|
|
1587
|
+
array[resultLength++] = array[i];
|
|
1588
|
+
}
|
|
1589
|
+
continue;
|
|
1590
|
+
}
|
|
1591
|
+
if (!hasUndefined) {
|
|
1592
|
+
delete array[resultLength++];
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
array.length = resultLength;
|
|
1596
|
+
return array;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
function at(object, ...paths) {
|
|
1600
|
+
if (paths.length === 0) {
|
|
1601
|
+
return [];
|
|
1602
|
+
}
|
|
1603
|
+
const allPaths = [];
|
|
1604
|
+
for (let i = 0; i < paths.length; i++) {
|
|
1605
|
+
const path = paths[i];
|
|
1606
|
+
if (!isArrayLike(path) || isString(path)) {
|
|
1607
|
+
allPaths.push(path);
|
|
1608
|
+
continue;
|
|
1609
|
+
}
|
|
1610
|
+
for (let j = 0; j < path.length; j++) {
|
|
1611
|
+
allPaths.push(path[j]);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
const result = [];
|
|
1615
|
+
for (let i = 0; i < allPaths.length; i++) {
|
|
1616
|
+
result.push(get(object, allPaths[i]));
|
|
1617
|
+
}
|
|
1618
|
+
return result;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
function unset(obj, path) {
|
|
1622
|
+
if (obj == null) {
|
|
1623
|
+
return true;
|
|
1624
|
+
}
|
|
1625
|
+
switch (typeof path) {
|
|
1626
|
+
case 'symbol':
|
|
1627
|
+
case 'number':
|
|
1628
|
+
case 'object': {
|
|
1629
|
+
if (Array.isArray(path)) {
|
|
1630
|
+
return unsetWithPath(obj, path);
|
|
1631
|
+
}
|
|
1632
|
+
if (typeof path === 'number') {
|
|
1633
|
+
path = toKey(path);
|
|
1634
|
+
}
|
|
1635
|
+
else if (typeof path === 'object') {
|
|
1636
|
+
if (Object.is(path?.valueOf(), -0)) {
|
|
1637
|
+
path = '-0';
|
|
1638
|
+
}
|
|
1639
|
+
else {
|
|
1640
|
+
path = String(path);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (obj?.[path] === undefined) {
|
|
1644
|
+
return true;
|
|
1645
|
+
}
|
|
1646
|
+
try {
|
|
1647
|
+
delete obj[path];
|
|
1648
|
+
return true;
|
|
1649
|
+
}
|
|
1650
|
+
catch {
|
|
1651
|
+
return false;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
case 'string': {
|
|
1655
|
+
if (obj?.[path] === undefined && isDeepKey(path)) {
|
|
1656
|
+
return unsetWithPath(obj, toPath(path));
|
|
1657
|
+
}
|
|
1658
|
+
try {
|
|
1659
|
+
delete obj[path];
|
|
1660
|
+
return true;
|
|
1661
|
+
}
|
|
1662
|
+
catch {
|
|
1663
|
+
return false;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
function unsetWithPath(obj, path) {
|
|
1669
|
+
const parent = get(obj, path.slice(0, -1), obj);
|
|
1670
|
+
const lastKey = path[path.length - 1];
|
|
1671
|
+
if (parent?.[lastKey] === undefined) {
|
|
1672
|
+
return true;
|
|
1673
|
+
}
|
|
1674
|
+
try {
|
|
1675
|
+
delete parent[lastKey];
|
|
1676
|
+
return true;
|
|
1677
|
+
}
|
|
1678
|
+
catch {
|
|
1679
|
+
return false;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
function pullAt(array, ..._indices) {
|
|
1684
|
+
const indices = flatten(_indices, 1);
|
|
1685
|
+
if (!array) {
|
|
1686
|
+
return Array(indices.length);
|
|
1687
|
+
}
|
|
1688
|
+
const result = at(array, indices);
|
|
1689
|
+
const indicesToPull = indices
|
|
1690
|
+
.map(index => (isIndex(index, array.length) ? Number(index) : index))
|
|
1691
|
+
.sort((a, b) => b - a);
|
|
1692
|
+
for (const index of new Set(indicesToPull)) {
|
|
1693
|
+
if (isIndex(index, array.length)) {
|
|
1694
|
+
Array.prototype.splice.call(array, index, 1);
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1697
|
+
if (isKey(index, array)) {
|
|
1698
|
+
delete array[toKey(index)];
|
|
1699
|
+
continue;
|
|
1700
|
+
}
|
|
1701
|
+
const path = isArray(index) ? index : toPath(index);
|
|
1702
|
+
unset(array, path);
|
|
1703
|
+
}
|
|
1704
|
+
return result;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
function reduce(collection, iteratee = unary.identity, accumulator) {
|
|
1708
|
+
if (!collection) {
|
|
1709
|
+
return accumulator;
|
|
1710
|
+
}
|
|
1711
|
+
let keys;
|
|
1712
|
+
let startIndex = 0;
|
|
1713
|
+
if (isArrayLike(collection)) {
|
|
1714
|
+
keys = range$1.range(0, collection.length);
|
|
1715
|
+
if (accumulator == null && collection.length > 0) {
|
|
1716
|
+
accumulator = collection[0];
|
|
1717
|
+
startIndex += 1;
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
else {
|
|
1721
|
+
keys = Object.keys(collection);
|
|
1722
|
+
if (accumulator == null) {
|
|
1723
|
+
accumulator = collection[keys[0]];
|
|
1724
|
+
startIndex += 1;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
for (let i = startIndex; i < keys.length; i++) {
|
|
1728
|
+
const key = keys[i];
|
|
1729
|
+
const value = collection[key];
|
|
1730
|
+
accumulator = iteratee(accumulator, value, key, collection);
|
|
1731
|
+
}
|
|
1732
|
+
return accumulator;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
function reduceRight(collection, iteratee = unary.identity, accumulator) {
|
|
1736
|
+
if (!collection) {
|
|
1737
|
+
return accumulator;
|
|
1738
|
+
}
|
|
1739
|
+
let keys;
|
|
1740
|
+
let startIndex;
|
|
1741
|
+
if (isArrayLike(collection)) {
|
|
1742
|
+
keys = range$1.range(0, collection.length).reverse();
|
|
1743
|
+
if (accumulator == null && collection.length > 0) {
|
|
1744
|
+
accumulator = collection[collection.length - 1];
|
|
1745
|
+
startIndex = 1;
|
|
1746
|
+
}
|
|
1747
|
+
else {
|
|
1748
|
+
startIndex = 0;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
else {
|
|
1752
|
+
keys = Object.keys(collection).reverse();
|
|
1753
|
+
if (accumulator == null) {
|
|
1754
|
+
accumulator = collection[keys[0]];
|
|
1755
|
+
startIndex = 1;
|
|
1756
|
+
}
|
|
1757
|
+
else {
|
|
1758
|
+
startIndex = 0;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
for (let i = startIndex; i < keys.length; i++) {
|
|
1762
|
+
const key = keys[i];
|
|
1763
|
+
const value = collection[key];
|
|
1764
|
+
accumulator = iteratee(accumulator, value, key, collection);
|
|
1765
|
+
}
|
|
1766
|
+
return accumulator;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
function negate(func) {
|
|
1770
|
+
if (typeof func !== 'function') {
|
|
1771
|
+
throw new TypeError('Expected a function');
|
|
1772
|
+
}
|
|
1773
|
+
return function (...args) {
|
|
1774
|
+
return !func.apply(this, args);
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
function reject(source, predicate) {
|
|
1779
|
+
return filter(source, negate(iteratee(predicate)));
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
function remove(arr, shouldRemoveElement) {
|
|
1783
|
+
return zip$1.remove(arr, iteratee(shouldRemoveElement));
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
function reverse(array) {
|
|
1787
|
+
if (array == null) {
|
|
1788
|
+
return array;
|
|
1789
|
+
}
|
|
1790
|
+
return array.reverse();
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
function sample(collection) {
|
|
1794
|
+
if (collection == null) {
|
|
1795
|
+
return undefined;
|
|
1796
|
+
}
|
|
1797
|
+
if (isArrayLike(collection)) {
|
|
1798
|
+
return zip$1.sample(toArray$1(collection));
|
|
1799
|
+
}
|
|
1800
|
+
return zip$1.sample(Object.values(collection));
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
function size(target) {
|
|
1804
|
+
if (isPromise.isNil(target)) {
|
|
1805
|
+
return 0;
|
|
1806
|
+
}
|
|
1807
|
+
if (target instanceof Map || target instanceof Set) {
|
|
1808
|
+
return target.size;
|
|
1809
|
+
}
|
|
1810
|
+
return Object.keys(target).length;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
function slice(array, start, end) {
|
|
1814
|
+
if (!isArrayLike(array)) {
|
|
1815
|
+
return [];
|
|
1816
|
+
}
|
|
1817
|
+
const length = array.length;
|
|
1818
|
+
if (end === undefined) {
|
|
1819
|
+
end = length;
|
|
1820
|
+
}
|
|
1821
|
+
else if (typeof end !== 'number' && isIterateeCall(array, start, end)) {
|
|
1822
|
+
start = 0;
|
|
1823
|
+
end = length;
|
|
1824
|
+
}
|
|
1825
|
+
start = zip$1.toInteger(start);
|
|
1826
|
+
end = zip$1.toInteger(end);
|
|
1827
|
+
if (start < 0) {
|
|
1828
|
+
start = Math.max(length + start, 0);
|
|
1829
|
+
}
|
|
1830
|
+
else {
|
|
1831
|
+
start = Math.min(start, length);
|
|
1832
|
+
}
|
|
1833
|
+
if (end < 0) {
|
|
1834
|
+
end = Math.max(length + end, 0);
|
|
1835
|
+
}
|
|
1836
|
+
else {
|
|
1837
|
+
end = Math.min(end, length);
|
|
1838
|
+
}
|
|
1839
|
+
const resultLength = Math.max(end - start, 0);
|
|
1840
|
+
const result = new Array(resultLength);
|
|
1841
|
+
for (let i = 0; i < resultLength; ++i) {
|
|
1842
|
+
result[i] = array[start + i];
|
|
1843
|
+
}
|
|
1844
|
+
return result;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
function some(source, predicate, guard) {
|
|
1848
|
+
if (!source) {
|
|
1849
|
+
return false;
|
|
1850
|
+
}
|
|
1851
|
+
if (guard != null) {
|
|
1852
|
+
predicate = undefined;
|
|
1853
|
+
}
|
|
1854
|
+
if (!predicate) {
|
|
1855
|
+
predicate = unary.identity;
|
|
1856
|
+
}
|
|
1857
|
+
const values = Array.isArray(source) ? source : Object.values(source);
|
|
1858
|
+
switch (typeof predicate) {
|
|
1859
|
+
case 'function': {
|
|
1860
|
+
if (!Array.isArray(source)) {
|
|
1861
|
+
const keys = Object.keys(source);
|
|
1862
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1863
|
+
const key = keys[i];
|
|
1864
|
+
const value = source[key];
|
|
1865
|
+
if (predicate(value, key, source)) {
|
|
1866
|
+
return true;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
return false;
|
|
1870
|
+
}
|
|
1871
|
+
return values.some(predicate);
|
|
1872
|
+
}
|
|
1873
|
+
case 'object': {
|
|
1874
|
+
if (Array.isArray(predicate) && predicate.length === 2) {
|
|
1875
|
+
const key = predicate[0];
|
|
1876
|
+
const value = predicate[1];
|
|
1877
|
+
return values.some(matchesProperty(key, value));
|
|
1878
|
+
}
|
|
1879
|
+
else {
|
|
1880
|
+
return values.some(matches(predicate));
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
case 'number':
|
|
1884
|
+
case 'symbol':
|
|
1885
|
+
case 'string': {
|
|
1886
|
+
return values.some(property(predicate));
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
function sortBy(collection, ...criteria) {
|
|
1892
|
+
const length = criteria.length;
|
|
1893
|
+
if (length > 1 && isIterateeCall(collection, criteria[0], criteria[1])) {
|
|
1894
|
+
criteria = [];
|
|
1895
|
+
}
|
|
1896
|
+
else if (length > 2 && isIterateeCall(criteria[0], criteria[1], criteria[2])) {
|
|
1897
|
+
criteria = [criteria[0]];
|
|
1898
|
+
}
|
|
1899
|
+
return orderBy(collection, zip$1.flatten(criteria), ['asc']);
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
function isNaN(value) {
|
|
1903
|
+
return Number.isNaN(value);
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
function isNil(x) {
|
|
1907
|
+
return x == null;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
const MAX_ARRAY_LENGTH$3 = 4294967295;
|
|
1911
|
+
const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH$3 - 1;
|
|
1912
|
+
function sortedIndexBy(array, value, iteratee$1, retHighest) {
|
|
1913
|
+
let low = 0;
|
|
1914
|
+
let high = array == null ? 0 : array.length;
|
|
1915
|
+
if (high === 0 || isNil(array)) {
|
|
1916
|
+
return 0;
|
|
1917
|
+
}
|
|
1918
|
+
const iterateeFunction = iteratee(iteratee$1);
|
|
1919
|
+
const transformedValue = iterateeFunction(value);
|
|
1920
|
+
const valIsNaN = isNaN(transformedValue);
|
|
1921
|
+
const valIsNull = isPromise.isNull(transformedValue);
|
|
1922
|
+
const valIsSymbol = zip$1.isSymbol(transformedValue);
|
|
1923
|
+
const valIsUndefined = isPromise.isUndefined(transformedValue);
|
|
1924
|
+
while (low < high) {
|
|
1925
|
+
let setLow;
|
|
1926
|
+
const mid = Math.floor((low + high) / 2);
|
|
1927
|
+
const computed = iterateeFunction(array[mid]);
|
|
1928
|
+
const othIsDefined = !isPromise.isUndefined(computed);
|
|
1929
|
+
const othIsNull = isPromise.isNull(computed);
|
|
1930
|
+
const othIsReflexive = !isNaN(computed);
|
|
1931
|
+
const othIsSymbol = zip$1.isSymbol(computed);
|
|
1932
|
+
if (valIsNaN) {
|
|
1933
|
+
setLow = retHighest || othIsReflexive;
|
|
1934
|
+
}
|
|
1935
|
+
else if (valIsUndefined) {
|
|
1936
|
+
setLow = othIsReflexive && (retHighest || othIsDefined);
|
|
1937
|
+
}
|
|
1938
|
+
else if (valIsNull) {
|
|
1939
|
+
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
|
1940
|
+
}
|
|
1941
|
+
else if (valIsSymbol) {
|
|
1942
|
+
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
|
1943
|
+
}
|
|
1944
|
+
else if (othIsNull || othIsSymbol) {
|
|
1945
|
+
setLow = false;
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
setLow = retHighest ? computed <= transformedValue : computed < transformedValue;
|
|
1949
|
+
}
|
|
1950
|
+
if (setLow) {
|
|
1951
|
+
low = mid + 1;
|
|
1952
|
+
}
|
|
1953
|
+
else {
|
|
1954
|
+
high = mid;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
return Math.min(high, MAX_ARRAY_INDEX);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
function isNumber(value) {
|
|
1961
|
+
return typeof value === 'number' || value instanceof Number;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
const MAX_ARRAY_LENGTH$2 = 4294967295;
|
|
1965
|
+
const HALF_MAX_ARRAY_LENGTH$1 = MAX_ARRAY_LENGTH$2 >>> 1;
|
|
1966
|
+
function sortedIndex(array, value) {
|
|
1967
|
+
if (isPromise.isNil(array)) {
|
|
1968
|
+
return 0;
|
|
1969
|
+
}
|
|
1970
|
+
let low = 0, high = isPromise.isNil(array) ? low : array.length;
|
|
1971
|
+
if (isNumber(value) && value === value && high <= HALF_MAX_ARRAY_LENGTH$1) {
|
|
1972
|
+
while (low < high) {
|
|
1973
|
+
const mid = (low + high) >>> 1;
|
|
1974
|
+
const compute = array[mid];
|
|
1975
|
+
if (!isPromise.isNull(compute) && !isPromise.isSymbol(compute) && compute < value) {
|
|
1976
|
+
low = mid + 1;
|
|
1977
|
+
}
|
|
1978
|
+
else {
|
|
1979
|
+
high = mid;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
return high;
|
|
1983
|
+
}
|
|
1984
|
+
return sortedIndexBy(array, value, value => value);
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
function sortedIndexOf(array, value) {
|
|
1988
|
+
if (!array?.length) {
|
|
1989
|
+
return -1;
|
|
1990
|
+
}
|
|
1991
|
+
const index = sortedIndex(array, value);
|
|
1992
|
+
if (index < array.length && isPromise.eq(array[index], value)) {
|
|
1993
|
+
return index;
|
|
1994
|
+
}
|
|
1995
|
+
return -1;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
function sortedLastIndexBy(array, value, iteratee) {
|
|
1999
|
+
return sortedIndexBy(array, value, iteratee, true);
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
const MAX_ARRAY_LENGTH$1 = 4294967295;
|
|
2003
|
+
const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH$1 >>> 1;
|
|
2004
|
+
function sortedLastIndex(array, value) {
|
|
2005
|
+
if (isPromise.isNil(array)) {
|
|
2006
|
+
return 0;
|
|
2007
|
+
}
|
|
2008
|
+
let high = array.length;
|
|
2009
|
+
if (!isNumber(value) || Number.isNaN(value) || high > HALF_MAX_ARRAY_LENGTH) {
|
|
2010
|
+
return sortedLastIndexBy(array, value, value => value);
|
|
2011
|
+
}
|
|
2012
|
+
let low = 0;
|
|
2013
|
+
while (low < high) {
|
|
2014
|
+
const mid = (low + high) >>> 1;
|
|
2015
|
+
const compute = array[mid];
|
|
2016
|
+
if (!isPromise.isNull(compute) && !isPromise.isSymbol(compute) && compute <= value) {
|
|
2017
|
+
low = mid + 1;
|
|
2018
|
+
}
|
|
2019
|
+
else {
|
|
2020
|
+
high = mid;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
return high;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
function tail(arr) {
|
|
2027
|
+
if (!isArrayLike(arr)) {
|
|
2028
|
+
return [];
|
|
2029
|
+
}
|
|
2030
|
+
return zip$1.tail(toArray$1(arr));
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
function take(arr, count = 1, guard) {
|
|
2034
|
+
count = guard ? 1 : zip$1.toInteger(count);
|
|
2035
|
+
if (count < 1 || !isArrayLike(arr)) {
|
|
2036
|
+
return [];
|
|
2037
|
+
}
|
|
2038
|
+
return zip$1.take(toArray$1(arr), count);
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
function takeRight(arr, count = 1, guard) {
|
|
2042
|
+
count = guard ? 1 : zip$1.toInteger(count);
|
|
2043
|
+
if (count <= 0 || !isArrayLike(arr)) {
|
|
2044
|
+
return [];
|
|
2045
|
+
}
|
|
2046
|
+
return zip$1.takeRight(toArray$1(arr), count);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
function takeRightWhile(_array, predicate) {
|
|
2050
|
+
if (!isArrayLikeObject(_array)) {
|
|
2051
|
+
return [];
|
|
2052
|
+
}
|
|
2053
|
+
const array = toArray$1(_array);
|
|
2054
|
+
const index = array.findLastIndex(unary.negate(iteratee(predicate)));
|
|
2055
|
+
return array.slice(index + 1);
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
function takeWhile(array, predicate) {
|
|
2059
|
+
if (!isArrayLikeObject(array)) {
|
|
2060
|
+
return [];
|
|
2061
|
+
}
|
|
2062
|
+
const _array = toArray$1(array);
|
|
2063
|
+
const index = _array.findIndex(negate(iteratee(predicate)));
|
|
2064
|
+
return index === -1 ? _array : _array.slice(0, index);
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
function union(...arrays) {
|
|
2068
|
+
const validArrays = arrays.filter(isArrayLikeObject);
|
|
2069
|
+
const flattened = flatten(validArrays, 1);
|
|
2070
|
+
return zip$1.uniq(flattened);
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
function unionBy(...values) {
|
|
2074
|
+
const lastValue = zip$1.last(values);
|
|
2075
|
+
const flattened = flattenArrayLike(values);
|
|
2076
|
+
if (isArrayLikeObject(lastValue) || lastValue == null) {
|
|
2077
|
+
return zip$1.uniq(flattened);
|
|
2078
|
+
}
|
|
2079
|
+
return zip$1.uniqBy(flattened, iteratee(lastValue));
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
function unionWith(...values) {
|
|
2083
|
+
const lastValue = zip$1.last(values);
|
|
2084
|
+
const flattened = flattenArrayLike(values);
|
|
2085
|
+
if (isArrayLikeObject(lastValue) || lastValue == null) {
|
|
2086
|
+
return zip$1.uniq(flattened);
|
|
2087
|
+
}
|
|
2088
|
+
return zip$1.uniqWith(flattened, lastValue);
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
function uniqBy(array, iteratee$1) {
|
|
2092
|
+
if (!isArrayLikeObject(array)) {
|
|
2093
|
+
return [];
|
|
2094
|
+
}
|
|
2095
|
+
return zip$1.uniqBy(Array.from(array), iteratee(iteratee$1));
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
function uniqWith(arr, comparator) {
|
|
2099
|
+
if (!isArrayLike(arr)) {
|
|
2100
|
+
return [];
|
|
2101
|
+
}
|
|
2102
|
+
return typeof comparator === 'function' ? zip$1.uniqWith(Array.from(arr), comparator) : uniq(Array.from(arr));
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
function unzip(array) {
|
|
2106
|
+
if (!isArrayLikeObject(array) || !array.length) {
|
|
2107
|
+
return [];
|
|
2108
|
+
}
|
|
2109
|
+
array = isArray(array) ? array : Array.from(array);
|
|
2110
|
+
array = array.filter(item => isArrayLikeObject(item));
|
|
2111
|
+
return zip$1.unzip(array);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
function without(array, ...values) {
|
|
2115
|
+
if (!isArrayLikeObject(array)) {
|
|
2116
|
+
return [];
|
|
2117
|
+
}
|
|
2118
|
+
return zip$1.without(Array.from(array), ...values);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
function zip(...arrays) {
|
|
2122
|
+
if (!arrays.length) {
|
|
2123
|
+
return [];
|
|
2124
|
+
}
|
|
2125
|
+
return zip$1.zip(...arrays.filter(group => isArrayLikeObject(group)));
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
const assignValue = (object, key, value) => {
|
|
2129
|
+
const objValue = object[key];
|
|
2130
|
+
if (!(Object.hasOwn(object, key) && isPromise.eq(objValue, value)) || (value === undefined && !(key in object))) {
|
|
2131
|
+
object[key] = value;
|
|
2132
|
+
}
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
function zipObject(keys = [], values = []) {
|
|
2136
|
+
const result = {};
|
|
2137
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2138
|
+
assignValue(result, keys[i], values[i]);
|
|
2139
|
+
}
|
|
2140
|
+
return result;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
function updateWith(obj, path, updater, customizer) {
|
|
2144
|
+
if (obj == null && !isObject(obj)) {
|
|
2145
|
+
return obj;
|
|
2146
|
+
}
|
|
2147
|
+
const resolvedPath = isKey(path, obj)
|
|
2148
|
+
? [path]
|
|
2149
|
+
: Array.isArray(path)
|
|
2150
|
+
? path
|
|
2151
|
+
: typeof path === 'string'
|
|
2152
|
+
? toPath(path)
|
|
2153
|
+
: [path];
|
|
2154
|
+
let current = obj;
|
|
2155
|
+
for (let i = 0; i < resolvedPath.length && current != null; i++) {
|
|
2156
|
+
const key = toKey(resolvedPath[i]);
|
|
2157
|
+
let newValue;
|
|
2158
|
+
if (i === resolvedPath.length - 1) {
|
|
2159
|
+
newValue = updater(current[key]);
|
|
2160
|
+
}
|
|
2161
|
+
else {
|
|
2162
|
+
const objValue = current[key];
|
|
2163
|
+
const customizerResult = customizer(objValue);
|
|
2164
|
+
newValue =
|
|
2165
|
+
customizerResult !== undefined
|
|
2166
|
+
? customizerResult
|
|
2167
|
+
: isObject(objValue)
|
|
2168
|
+
? objValue
|
|
2169
|
+
: isIndex(resolvedPath[i + 1])
|
|
2170
|
+
? []
|
|
2171
|
+
: {};
|
|
2172
|
+
}
|
|
2173
|
+
assignValue(current, key, newValue);
|
|
2174
|
+
current = current[key];
|
|
2175
|
+
}
|
|
2176
|
+
return obj;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
function set(obj, path, value) {
|
|
2180
|
+
return updateWith(obj, path, () => value, () => undefined);
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
function zipObjectDeep(keys, values) {
|
|
2184
|
+
const result = {};
|
|
2185
|
+
if (!isArrayLike(keys)) {
|
|
2186
|
+
return result;
|
|
2187
|
+
}
|
|
2188
|
+
if (!isArrayLike(values)) {
|
|
2189
|
+
values = [];
|
|
2190
|
+
}
|
|
2191
|
+
const zipped = zip$1.zip(Array.from(keys), Array.from(values));
|
|
2192
|
+
for (let i = 0; i < zipped.length; i++) {
|
|
2193
|
+
const [key, value] = zipped[i];
|
|
2194
|
+
if (key != null) {
|
|
2195
|
+
set(result, key, value);
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
return result;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
function zipWith(...combine) {
|
|
2202
|
+
let iteratee = combine.pop();
|
|
2203
|
+
if (!isPromise.isFunction(iteratee)) {
|
|
2204
|
+
combine.push(iteratee);
|
|
2205
|
+
iteratee = undefined;
|
|
2206
|
+
}
|
|
2207
|
+
if (!combine?.length) {
|
|
2208
|
+
return [];
|
|
2209
|
+
}
|
|
2210
|
+
const result = unzip(combine);
|
|
2211
|
+
if (iteratee == null) {
|
|
2212
|
+
return result;
|
|
2213
|
+
}
|
|
2214
|
+
return result.map(group => iteratee(...group));
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
function after(n, func) {
|
|
2218
|
+
if (typeof func !== 'function') {
|
|
2219
|
+
throw new TypeError('Expected a function');
|
|
2220
|
+
}
|
|
2221
|
+
n = zip$1.toInteger(n);
|
|
2222
|
+
return function (...args) {
|
|
2223
|
+
if (--n < 1) {
|
|
2224
|
+
return func.apply(this, args);
|
|
2225
|
+
}
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
function ary(func, n = func.length, guard) {
|
|
2230
|
+
if (guard) {
|
|
2231
|
+
n = func.length;
|
|
2232
|
+
}
|
|
2233
|
+
if (Number.isNaN(n) || n < 0) {
|
|
2234
|
+
n = 0;
|
|
2235
|
+
}
|
|
2236
|
+
return unary.ary(func, n);
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
function attempt(func, ...args) {
|
|
2240
|
+
try {
|
|
2241
|
+
return func(...args);
|
|
2242
|
+
}
|
|
2243
|
+
catch (e) {
|
|
2244
|
+
return e instanceof Error ? e : new Error(e);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
function before(n, func) {
|
|
2249
|
+
if (typeof func !== 'function') {
|
|
2250
|
+
throw new TypeError('Expected a function');
|
|
2251
|
+
}
|
|
2252
|
+
let result;
|
|
2253
|
+
n = zip$1.toInteger(n);
|
|
2254
|
+
return function (...args) {
|
|
2255
|
+
if (--n > 0) {
|
|
2256
|
+
result = func.apply(this, args);
|
|
2257
|
+
}
|
|
2258
|
+
if (n <= 1 && func) {
|
|
2259
|
+
func = undefined;
|
|
2260
|
+
}
|
|
2261
|
+
return result;
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
function bind(func, thisObj, ...partialArgs) {
|
|
2266
|
+
const bound = function (...providedArgs) {
|
|
2267
|
+
const args = [];
|
|
2268
|
+
let startIndex = 0;
|
|
2269
|
+
for (let i = 0; i < partialArgs.length; i++) {
|
|
2270
|
+
const arg = partialArgs[i];
|
|
2271
|
+
if (arg === bind.placeholder) {
|
|
2272
|
+
args.push(providedArgs[startIndex++]);
|
|
2273
|
+
}
|
|
2274
|
+
else {
|
|
2275
|
+
args.push(arg);
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
2279
|
+
args.push(providedArgs[i]);
|
|
2280
|
+
}
|
|
2281
|
+
if (this instanceof bound) {
|
|
2282
|
+
return new func(...args);
|
|
2283
|
+
}
|
|
2284
|
+
return func.apply(thisObj, args);
|
|
2285
|
+
};
|
|
2286
|
+
return bound;
|
|
2287
|
+
}
|
|
2288
|
+
const bindPlaceholder = Symbol('bind.placeholder');
|
|
2289
|
+
bind.placeholder = bindPlaceholder;
|
|
2290
|
+
|
|
2291
|
+
function bindKey(object, key, ...partialArgs) {
|
|
2292
|
+
const bound = function (...providedArgs) {
|
|
2293
|
+
const args = [];
|
|
2294
|
+
let startIndex = 0;
|
|
2295
|
+
for (let i = 0; i < partialArgs.length; i++) {
|
|
2296
|
+
const arg = partialArgs[i];
|
|
2297
|
+
if (arg === bindKey.placeholder) {
|
|
2298
|
+
args.push(providedArgs[startIndex++]);
|
|
2299
|
+
}
|
|
2300
|
+
else {
|
|
2301
|
+
args.push(arg);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
2305
|
+
args.push(providedArgs[i]);
|
|
2306
|
+
}
|
|
2307
|
+
if (this instanceof bound) {
|
|
2308
|
+
return new object[key](...args);
|
|
2309
|
+
}
|
|
2310
|
+
return object[key].apply(object, args);
|
|
2311
|
+
};
|
|
2312
|
+
return bound;
|
|
2313
|
+
}
|
|
2314
|
+
const bindKeyPlaceholder = Symbol('bindKey.placeholder');
|
|
2315
|
+
bindKey.placeholder = bindKeyPlaceholder;
|
|
2316
|
+
|
|
2317
|
+
function curry(func, arity = func.length, guard) {
|
|
2318
|
+
arity = guard ? func.length : arity;
|
|
2319
|
+
arity = Number.parseInt(arity, 10);
|
|
2320
|
+
if (Number.isNaN(arity) || arity < 1) {
|
|
2321
|
+
arity = 0;
|
|
2322
|
+
}
|
|
2323
|
+
const wrapper = function (...partialArgs) {
|
|
2324
|
+
const holders = partialArgs.filter(item => item === curry.placeholder);
|
|
2325
|
+
const length = partialArgs.length - holders.length;
|
|
2326
|
+
if (length < arity) {
|
|
2327
|
+
return makeCurry(func, arity - length, partialArgs);
|
|
2328
|
+
}
|
|
2329
|
+
if (this instanceof wrapper) {
|
|
2330
|
+
return new func(...partialArgs);
|
|
2331
|
+
}
|
|
2332
|
+
return func.apply(this, partialArgs);
|
|
2333
|
+
};
|
|
2334
|
+
wrapper.placeholder = curryPlaceholder;
|
|
2335
|
+
return wrapper;
|
|
2336
|
+
}
|
|
2337
|
+
function makeCurry(func, arity, partialArgs) {
|
|
2338
|
+
function wrapper(...providedArgs) {
|
|
2339
|
+
const holders = providedArgs.filter(item => item === curry.placeholder);
|
|
2340
|
+
const length = providedArgs.length - holders.length;
|
|
2341
|
+
providedArgs = composeArgs$1(providedArgs, partialArgs);
|
|
2342
|
+
if (length < arity) {
|
|
2343
|
+
return makeCurry(func, arity - length, providedArgs);
|
|
2344
|
+
}
|
|
2345
|
+
if (this instanceof wrapper) {
|
|
2346
|
+
return new func(...providedArgs);
|
|
2347
|
+
}
|
|
2348
|
+
return func.apply(this, providedArgs);
|
|
2349
|
+
}
|
|
2350
|
+
wrapper.placeholder = curryPlaceholder;
|
|
2351
|
+
return wrapper;
|
|
2352
|
+
}
|
|
2353
|
+
function composeArgs$1(providedArgs, partialArgs) {
|
|
2354
|
+
const args = [];
|
|
2355
|
+
let startIndex = 0;
|
|
2356
|
+
for (let i = 0; i < partialArgs.length; i++) {
|
|
2357
|
+
const arg = partialArgs[i];
|
|
2358
|
+
if (arg === curry.placeholder && startIndex < providedArgs.length) {
|
|
2359
|
+
args.push(providedArgs[startIndex++]);
|
|
2360
|
+
}
|
|
2361
|
+
else {
|
|
2362
|
+
args.push(arg);
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
2366
|
+
args.push(providedArgs[i]);
|
|
2367
|
+
}
|
|
2368
|
+
return args;
|
|
2369
|
+
}
|
|
2370
|
+
const curryPlaceholder = Symbol('curry.placeholder');
|
|
2371
|
+
curry.placeholder = curryPlaceholder;
|
|
2372
|
+
|
|
2373
|
+
function curryRight(func, arity = func.length, guard) {
|
|
2374
|
+
arity = guard ? func.length : arity;
|
|
2375
|
+
arity = Number.parseInt(arity, 10);
|
|
2376
|
+
if (Number.isNaN(arity) || arity < 1) {
|
|
2377
|
+
arity = 0;
|
|
2378
|
+
}
|
|
2379
|
+
const wrapper = function (...partialArgs) {
|
|
2380
|
+
const holders = partialArgs.filter(item => item === curryRight.placeholder);
|
|
2381
|
+
const length = partialArgs.length - holders.length;
|
|
2382
|
+
if (length < arity) {
|
|
2383
|
+
return makeCurryRight(func, arity - length, partialArgs);
|
|
2384
|
+
}
|
|
2385
|
+
if (this instanceof wrapper) {
|
|
2386
|
+
return new func(...partialArgs);
|
|
2387
|
+
}
|
|
2388
|
+
return func.apply(this, partialArgs);
|
|
2389
|
+
};
|
|
2390
|
+
wrapper.placeholder = curryRightPlaceholder;
|
|
2391
|
+
return wrapper;
|
|
2392
|
+
}
|
|
2393
|
+
function makeCurryRight(func, arity, partialArgs) {
|
|
2394
|
+
function wrapper(...providedArgs) {
|
|
2395
|
+
const holders = providedArgs.filter(item => item === curryRight.placeholder);
|
|
2396
|
+
const length = providedArgs.length - holders.length;
|
|
2397
|
+
providedArgs = composeArgs(providedArgs, partialArgs);
|
|
2398
|
+
if (length < arity) {
|
|
2399
|
+
return makeCurryRight(func, arity - length, providedArgs);
|
|
2400
|
+
}
|
|
2401
|
+
if (this instanceof wrapper) {
|
|
2402
|
+
return new func(...providedArgs);
|
|
2403
|
+
}
|
|
2404
|
+
return func.apply(this, providedArgs);
|
|
2405
|
+
}
|
|
2406
|
+
wrapper.placeholder = curryRightPlaceholder;
|
|
2407
|
+
return wrapper;
|
|
2408
|
+
}
|
|
2409
|
+
function composeArgs(providedArgs, partialArgs) {
|
|
2410
|
+
const placeholderLength = partialArgs.filter(arg => arg === curryRight.placeholder).length;
|
|
2411
|
+
const rangeLength = Math.max(providedArgs.length - placeholderLength, 0);
|
|
2412
|
+
const args = [];
|
|
2413
|
+
let providedIndex = 0;
|
|
2414
|
+
for (let i = 0; i < rangeLength; i++) {
|
|
2415
|
+
args.push(providedArgs[providedIndex++]);
|
|
2416
|
+
}
|
|
2417
|
+
for (let i = 0; i < partialArgs.length; i++) {
|
|
2418
|
+
const arg = partialArgs[i];
|
|
2419
|
+
if (arg === curryRight.placeholder) {
|
|
2420
|
+
if (providedIndex < providedArgs.length) {
|
|
2421
|
+
args.push(providedArgs[providedIndex++]);
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
args.push(arg);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2428
|
+
args.push(arg);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
return args;
|
|
2432
|
+
}
|
|
2433
|
+
const curryRightPlaceholder = Symbol('curryRight.placeholder');
|
|
2434
|
+
curryRight.placeholder = curryRightPlaceholder;
|
|
2435
|
+
|
|
2436
|
+
function debounce(func, debounceMs = 0, options = {}) {
|
|
2437
|
+
if (typeof options !== 'object') {
|
|
2438
|
+
options = {};
|
|
2439
|
+
}
|
|
2440
|
+
const { signal, leading = false, trailing = true, maxWait } = options;
|
|
2441
|
+
const edges = Array(2);
|
|
2442
|
+
if (leading) {
|
|
2443
|
+
edges[0] = 'leading';
|
|
2444
|
+
}
|
|
2445
|
+
if (trailing) {
|
|
2446
|
+
edges[1] = 'trailing';
|
|
2447
|
+
}
|
|
2448
|
+
let result = undefined;
|
|
2449
|
+
let pendingAt = null;
|
|
2450
|
+
const _debounced = unary.debounce(function (...args) {
|
|
2451
|
+
result = func.apply(this, args);
|
|
2452
|
+
pendingAt = null;
|
|
2453
|
+
}, debounceMs, { signal, edges });
|
|
2454
|
+
const debounced = function (...args) {
|
|
2455
|
+
if (maxWait != null) {
|
|
2456
|
+
if (pendingAt === null) {
|
|
2457
|
+
pendingAt = Date.now();
|
|
2458
|
+
}
|
|
2459
|
+
else {
|
|
2460
|
+
if (Date.now() - pendingAt >= maxWait) {
|
|
2461
|
+
result = func.apply(this, args);
|
|
2462
|
+
pendingAt = Date.now();
|
|
2463
|
+
_debounced.cancel();
|
|
2464
|
+
_debounced.schedule();
|
|
2465
|
+
return result;
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
_debounced.apply(this, args);
|
|
2470
|
+
return result;
|
|
2471
|
+
};
|
|
2472
|
+
const flush = () => {
|
|
2473
|
+
_debounced.flush();
|
|
2474
|
+
return result;
|
|
2475
|
+
};
|
|
2476
|
+
debounced.cancel = _debounced.cancel;
|
|
2477
|
+
debounced.flush = flush;
|
|
2478
|
+
return debounced;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
function defer(func, ...args) {
|
|
2482
|
+
if (typeof func !== 'function') {
|
|
2483
|
+
throw new TypeError('Expected a function');
|
|
2484
|
+
}
|
|
2485
|
+
return setTimeout(func, 1, ...args);
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
function delay(func, wait, ...args) {
|
|
2489
|
+
if (typeof func !== 'function') {
|
|
2490
|
+
throw new TypeError('Expected a function');
|
|
2491
|
+
}
|
|
2492
|
+
return setTimeout(func, zip$1.toNumber(wait) || 0, ...args);
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
function flip(func) {
|
|
2496
|
+
return function (...args) {
|
|
2497
|
+
return func.apply(this, args.reverse());
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
function flow(...funcs) {
|
|
2502
|
+
const flattenFuncs = zip$1.flatten(funcs, 1);
|
|
2503
|
+
if (flattenFuncs.some(func => typeof func !== 'function')) {
|
|
2504
|
+
throw new TypeError('Expected a function');
|
|
2505
|
+
}
|
|
2506
|
+
return unary.flow(...flattenFuncs);
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
function flowRight(...funcs) {
|
|
2510
|
+
const flattenFuncs = zip$1.flatten(funcs, 1);
|
|
2511
|
+
if (flattenFuncs.some(func => typeof func !== 'function')) {
|
|
2512
|
+
throw new TypeError('Expected a function');
|
|
2513
|
+
}
|
|
2514
|
+
return unary.flowRight(...flattenFuncs);
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
function nthArg(n = 0) {
|
|
2518
|
+
return function (...args) {
|
|
2519
|
+
return args.at(zip$1.toInteger(n));
|
|
2520
|
+
};
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
function partial(func, ...partialArgs) {
|
|
2524
|
+
return unary.partialImpl(func, partial.placeholder, ...partialArgs);
|
|
2525
|
+
}
|
|
2526
|
+
partial.placeholder = Symbol('compat.partial.placeholder');
|
|
2527
|
+
|
|
2528
|
+
function partialRight(func, ...partialArgs) {
|
|
2529
|
+
return unary.partialRightImpl(func, partialRight.placeholder, ...partialArgs);
|
|
2530
|
+
}
|
|
2531
|
+
partialRight.placeholder = Symbol('compat.partialRight.placeholder');
|
|
2532
|
+
|
|
2533
|
+
function rearg(func, ...indices) {
|
|
2534
|
+
const flattenIndices = flatten(indices);
|
|
2535
|
+
return function (...args) {
|
|
2536
|
+
const reorderedArgs = flattenIndices.map(i => args[i]).slice(0, args.length);
|
|
2537
|
+
for (let i = reorderedArgs.length; i < args.length; i++) {
|
|
2538
|
+
reorderedArgs.push(args[i]);
|
|
2539
|
+
}
|
|
2540
|
+
return func.apply(this, reorderedArgs);
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
function rest(func, start = func.length - 1) {
|
|
2545
|
+
start = Number.parseInt(start, 10);
|
|
2546
|
+
if (Number.isNaN(start) || start < 0) {
|
|
2547
|
+
start = func.length - 1;
|
|
2548
|
+
}
|
|
2549
|
+
return unary.rest(func, start);
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
function spread(func, argsIndex = 0) {
|
|
2553
|
+
argsIndex = Number.parseInt(argsIndex, 10);
|
|
2554
|
+
if (Number.isNaN(argsIndex) || argsIndex < 0) {
|
|
2555
|
+
argsIndex = 0;
|
|
2556
|
+
}
|
|
2557
|
+
return function (...args) {
|
|
2558
|
+
const array = args[argsIndex];
|
|
2559
|
+
const params = args.slice(0, argsIndex);
|
|
2560
|
+
if (array) {
|
|
2561
|
+
params.push(...array);
|
|
2562
|
+
}
|
|
2563
|
+
return func.apply(this, params);
|
|
2564
|
+
};
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
function throttle(func, throttleMs = 0, options = {}) {
|
|
2568
|
+
if (typeof options !== 'object') {
|
|
2569
|
+
options = {};
|
|
2570
|
+
}
|
|
2571
|
+
const { leading = true, trailing = true, signal } = options;
|
|
2572
|
+
return debounce(func, throttleMs, {
|
|
2573
|
+
leading,
|
|
2574
|
+
trailing,
|
|
2575
|
+
signal,
|
|
2576
|
+
maxWait: throttleMs,
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
function toString(value) {
|
|
2581
|
+
if (value == null) {
|
|
2582
|
+
return '';
|
|
2583
|
+
}
|
|
2584
|
+
if (Array.isArray(value)) {
|
|
2585
|
+
return value.map(toString).join(',');
|
|
2586
|
+
}
|
|
2587
|
+
const result = String(value);
|
|
2588
|
+
if (result === '0' && Object.is(Number(value), -0)) {
|
|
2589
|
+
return '-0';
|
|
2590
|
+
}
|
|
2591
|
+
return result;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
function add(value, other) {
|
|
2595
|
+
if (value === undefined && other === undefined) {
|
|
2596
|
+
return 0;
|
|
2597
|
+
}
|
|
2598
|
+
if (value === undefined || other === undefined) {
|
|
2599
|
+
return value ?? other;
|
|
2600
|
+
}
|
|
2601
|
+
if (typeof value === 'string' || typeof other === 'string') {
|
|
2602
|
+
value = toString(value);
|
|
2603
|
+
other = toString(other);
|
|
2604
|
+
}
|
|
2605
|
+
else {
|
|
2606
|
+
value = zip$1.toNumber(value);
|
|
2607
|
+
other = zip$1.toNumber(other);
|
|
2608
|
+
}
|
|
2609
|
+
return value + other;
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
function decimalAdjust(type, number, precision = 0) {
|
|
2613
|
+
number = Number(number);
|
|
2614
|
+
if (Object.is(number, -0)) {
|
|
2615
|
+
number = '-0';
|
|
2616
|
+
}
|
|
2617
|
+
precision = Math.min(Number.parseInt(precision, 10), 292);
|
|
2618
|
+
if (precision) {
|
|
2619
|
+
const [magnitude, exponent = 0] = number.toString().split('e');
|
|
2620
|
+
let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`));
|
|
2621
|
+
if (Object.is(adjustedValue, -0)) {
|
|
2622
|
+
adjustedValue = '-0';
|
|
2623
|
+
}
|
|
2624
|
+
const [newMagnitude, newExponent = 0] = adjustedValue.toString().split('e');
|
|
2625
|
+
return Number(`${newMagnitude}e${Number(newExponent) - precision}`);
|
|
2626
|
+
}
|
|
2627
|
+
return Math[type](Number(number));
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
function ceil(number, precision = 0) {
|
|
2631
|
+
return decimalAdjust('ceil', number, precision);
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
function clamp(value, bound1, bound2) {
|
|
2635
|
+
if (Number.isNaN(bound1)) {
|
|
2636
|
+
bound1 = 0;
|
|
2637
|
+
}
|
|
2638
|
+
if (Number.isNaN(bound2)) {
|
|
2639
|
+
bound2 = 0;
|
|
2640
|
+
}
|
|
2641
|
+
return range$1.clamp(value, bound1, bound2);
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
function divide(value, other) {
|
|
2645
|
+
if (value === undefined && other === undefined) {
|
|
2646
|
+
return 1;
|
|
2647
|
+
}
|
|
2648
|
+
if (value === undefined || other === undefined) {
|
|
2649
|
+
return value ?? other;
|
|
2650
|
+
}
|
|
2651
|
+
if (typeof value === 'string' || typeof other === 'string') {
|
|
2652
|
+
value = toString(value);
|
|
2653
|
+
other = toString(other);
|
|
2654
|
+
}
|
|
2655
|
+
else {
|
|
2656
|
+
value = zip$1.toNumber(value);
|
|
2657
|
+
other = zip$1.toNumber(other);
|
|
2658
|
+
}
|
|
2659
|
+
return value / other;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
function floor(number, precision = 0) {
|
|
2663
|
+
return decimalAdjust('floor', number, precision);
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
function inRange(value, minimum, maximum) {
|
|
2667
|
+
if (!minimum) {
|
|
2668
|
+
minimum = 0;
|
|
2669
|
+
}
|
|
2670
|
+
if (maximum != null && !maximum) {
|
|
2671
|
+
maximum = 0;
|
|
2672
|
+
}
|
|
2673
|
+
if (minimum != null && typeof minimum !== 'number') {
|
|
2674
|
+
minimum = Number(minimum);
|
|
2675
|
+
}
|
|
2676
|
+
if (maximum == null && minimum === 0) {
|
|
2677
|
+
return false;
|
|
2678
|
+
}
|
|
2679
|
+
if (maximum != null && typeof maximum !== 'number') {
|
|
2680
|
+
maximum = Number(maximum);
|
|
2681
|
+
}
|
|
2682
|
+
if (maximum != null && minimum > maximum) {
|
|
2683
|
+
[minimum, maximum] = [maximum, minimum];
|
|
2684
|
+
}
|
|
2685
|
+
if (minimum === maximum) {
|
|
2686
|
+
return false;
|
|
2687
|
+
}
|
|
2688
|
+
return range$1.inRange(value, minimum, maximum);
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
function max(items = []) {
|
|
2692
|
+
let maxElement = items[0];
|
|
2693
|
+
let max = undefined;
|
|
2694
|
+
for (let i = 0; i < items.length; i++) {
|
|
2695
|
+
const element = items[i];
|
|
2696
|
+
if (max == null || element > max) {
|
|
2697
|
+
max = element;
|
|
2698
|
+
maxElement = element;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
return maxElement;
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
function maxBy(items, iteratee$1) {
|
|
2705
|
+
if (items == null) {
|
|
2706
|
+
return undefined;
|
|
2707
|
+
}
|
|
2708
|
+
return zip$1.maxBy(Array.from(items), iteratee(iteratee$1));
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
function sumBy(array, iteratee$1) {
|
|
2712
|
+
if (!array || !array.length) {
|
|
2713
|
+
return 0;
|
|
2714
|
+
}
|
|
2715
|
+
if (iteratee$1 != null) {
|
|
2716
|
+
iteratee$1 = iteratee(iteratee$1);
|
|
2717
|
+
}
|
|
2718
|
+
let result = undefined;
|
|
2719
|
+
for (let i = 0; i < array.length; i++) {
|
|
2720
|
+
const current = iteratee$1 ? iteratee$1(array[i]) : array[i];
|
|
2721
|
+
if (current !== undefined) {
|
|
2722
|
+
if (result === undefined) {
|
|
2723
|
+
result = current;
|
|
2724
|
+
}
|
|
2725
|
+
else {
|
|
2726
|
+
result += current;
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
return result;
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
function sum(array) {
|
|
2734
|
+
return sumBy(array);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
function mean(nums) {
|
|
2738
|
+
const length = nums ? nums.length : 0;
|
|
2739
|
+
return length === 0 ? NaN : sum(nums) / length;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
function meanBy(items, iteratee$1) {
|
|
2743
|
+
if (items == null) {
|
|
2744
|
+
return NaN;
|
|
2745
|
+
}
|
|
2746
|
+
return range$1.meanBy(Array.from(items), iteratee(iteratee$1));
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
function min(items = []) {
|
|
2750
|
+
let minElement = items[0];
|
|
2751
|
+
let min = undefined;
|
|
2752
|
+
for (let i = 0; i < items.length; i++) {
|
|
2753
|
+
const element = items[i];
|
|
2754
|
+
if (min == null || element < min) {
|
|
2755
|
+
min = element;
|
|
2756
|
+
minElement = element;
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
return minElement;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
function minBy(items, iteratee$1) {
|
|
2763
|
+
if (items == null) {
|
|
2764
|
+
return undefined;
|
|
2765
|
+
}
|
|
2766
|
+
return zip$1.minBy(Array.from(items), iteratee(iteratee$1));
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
function multiply(value, other) {
|
|
2770
|
+
if (value === undefined && other === undefined) {
|
|
2771
|
+
return 1;
|
|
2772
|
+
}
|
|
2773
|
+
if (value === undefined || other === undefined) {
|
|
2774
|
+
return value ?? other;
|
|
2775
|
+
}
|
|
2776
|
+
if (typeof value === 'string' || typeof other === 'string') {
|
|
2777
|
+
value = toString(value);
|
|
2778
|
+
other = toString(other);
|
|
2779
|
+
}
|
|
2780
|
+
else {
|
|
2781
|
+
value = zip$1.toNumber(value);
|
|
2782
|
+
other = zip$1.toNumber(other);
|
|
2783
|
+
}
|
|
2784
|
+
return value * other;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
function parseInt(string, radix = 0, guard) {
|
|
2788
|
+
if (guard) {
|
|
2789
|
+
radix = 0;
|
|
2790
|
+
}
|
|
2791
|
+
return Number.parseInt(string, radix);
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
function random(...args) {
|
|
2795
|
+
let minimum = 0;
|
|
2796
|
+
let maximum = 1;
|
|
2797
|
+
let floating = false;
|
|
2798
|
+
switch (args.length) {
|
|
2799
|
+
case 1: {
|
|
2800
|
+
if (typeof args[0] === 'boolean') {
|
|
2801
|
+
floating = args[0];
|
|
2802
|
+
}
|
|
2803
|
+
else {
|
|
2804
|
+
maximum = args[0];
|
|
2805
|
+
}
|
|
2806
|
+
break;
|
|
2807
|
+
}
|
|
2808
|
+
case 2: {
|
|
2809
|
+
if (typeof args[1] === 'boolean') {
|
|
2810
|
+
maximum = args[0];
|
|
2811
|
+
floating = args[1];
|
|
2812
|
+
}
|
|
2813
|
+
else {
|
|
2814
|
+
minimum = args[0];
|
|
2815
|
+
maximum = args[1];
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
case 3: {
|
|
2819
|
+
if (typeof args[2] === 'object' && args[2] != null && args[2][args[1]] === args[0]) {
|
|
2820
|
+
minimum = 0;
|
|
2821
|
+
maximum = args[0];
|
|
2822
|
+
floating = false;
|
|
2823
|
+
}
|
|
2824
|
+
else {
|
|
2825
|
+
minimum = args[0];
|
|
2826
|
+
maximum = args[1];
|
|
2827
|
+
floating = args[2];
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
if (typeof minimum !== 'number') {
|
|
2832
|
+
minimum = Number(minimum);
|
|
2833
|
+
}
|
|
2834
|
+
if (typeof maximum !== 'number') {
|
|
2835
|
+
minimum = Number(maximum);
|
|
2836
|
+
}
|
|
2837
|
+
if (!minimum) {
|
|
2838
|
+
minimum = 0;
|
|
2839
|
+
}
|
|
2840
|
+
if (!maximum) {
|
|
2841
|
+
maximum = 0;
|
|
2842
|
+
}
|
|
2843
|
+
if (minimum > maximum) {
|
|
2844
|
+
[minimum, maximum] = [maximum, minimum];
|
|
2845
|
+
}
|
|
2846
|
+
minimum = clamp(minimum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
2847
|
+
maximum = clamp(maximum, -Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
|
|
2848
|
+
if (minimum === maximum) {
|
|
2849
|
+
return minimum;
|
|
2850
|
+
}
|
|
2851
|
+
if (floating) {
|
|
2852
|
+
return randomInt.random(minimum, maximum + 1);
|
|
2853
|
+
}
|
|
2854
|
+
else {
|
|
2855
|
+
return randomInt.randomInt(minimum, maximum + 1);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
function range(start, end, step) {
|
|
2860
|
+
if (step && typeof step !== 'number' && isIterateeCall(start, end, step)) {
|
|
2861
|
+
end = step = undefined;
|
|
2862
|
+
}
|
|
2863
|
+
start = zip$1.toFinite(start);
|
|
2864
|
+
if (end === undefined) {
|
|
2865
|
+
end = start;
|
|
2866
|
+
start = 0;
|
|
2867
|
+
}
|
|
2868
|
+
else {
|
|
2869
|
+
end = zip$1.toFinite(end);
|
|
2870
|
+
}
|
|
2871
|
+
step = step === undefined ? (start < end ? 1 : -1) : zip$1.toFinite(step);
|
|
2872
|
+
const length = Math.max(Math.ceil((end - start) / (step || 1)), 0);
|
|
2873
|
+
const result = new Array(length);
|
|
2874
|
+
for (let index = 0; index < length; index++) {
|
|
2875
|
+
result[index] = start;
|
|
2876
|
+
start += step;
|
|
2877
|
+
}
|
|
2878
|
+
return result;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
function rangeRight(start, end, step) {
|
|
2882
|
+
if (step && typeof step !== 'number' && isIterateeCall(start, end, step)) {
|
|
2883
|
+
end = step = undefined;
|
|
2884
|
+
}
|
|
2885
|
+
start = zip$1.toFinite(start);
|
|
2886
|
+
if (end === undefined) {
|
|
2887
|
+
end = start;
|
|
2888
|
+
start = 0;
|
|
2889
|
+
}
|
|
2890
|
+
else {
|
|
2891
|
+
end = zip$1.toFinite(end);
|
|
2892
|
+
}
|
|
2893
|
+
step = step === undefined ? (start < end ? 1 : -1) : zip$1.toFinite(step);
|
|
2894
|
+
const length = Math.max(Math.ceil((end - start) / (step || 1)), 0);
|
|
2895
|
+
const result = new Array(length);
|
|
2896
|
+
for (let index = length - 1; index >= 0; index--) {
|
|
2897
|
+
result[index] = start;
|
|
2898
|
+
start += step;
|
|
2899
|
+
}
|
|
2900
|
+
return result;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
function round(number, precision = 0) {
|
|
2904
|
+
return decimalAdjust('round', number, precision);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
function subtract(value, other) {
|
|
2908
|
+
if (value === undefined && other === undefined) {
|
|
2909
|
+
return 0;
|
|
2910
|
+
}
|
|
2911
|
+
if (value === undefined || other === undefined) {
|
|
2912
|
+
return value ?? other;
|
|
2913
|
+
}
|
|
2914
|
+
if (typeof value === 'string' || typeof other === 'string') {
|
|
2915
|
+
value = toString(value);
|
|
2916
|
+
other = toString(other);
|
|
2917
|
+
}
|
|
2918
|
+
else {
|
|
2919
|
+
value = zip$1.toNumber(value);
|
|
2920
|
+
other = zip$1.toNumber(other);
|
|
2921
|
+
}
|
|
2922
|
+
return value - other;
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
function isPrototype(value) {
|
|
2926
|
+
const constructor = value?.constructor;
|
|
2927
|
+
const prototype = typeof constructor === 'function' ? constructor.prototype : Object.prototype;
|
|
2928
|
+
return value === prototype;
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
function isTypedArray(x) {
|
|
2932
|
+
return isPromise.isTypedArray(x);
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
function times(n, getValue) {
|
|
2936
|
+
n = zip$1.toInteger(n);
|
|
2937
|
+
if (n < 1 || !Number.isSafeInteger(n)) {
|
|
2938
|
+
return [];
|
|
2939
|
+
}
|
|
2940
|
+
const result = new Array(n);
|
|
2941
|
+
for (let i = 0; i < n; i++) {
|
|
2942
|
+
result[i] = typeof getValue === 'function' ? getValue(i) : i;
|
|
2943
|
+
}
|
|
2944
|
+
return result;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
function keys(object) {
|
|
2948
|
+
if (isArrayLike(object)) {
|
|
2949
|
+
return arrayLikeKeys(object);
|
|
2950
|
+
}
|
|
2951
|
+
const result = Object.keys(Object(object));
|
|
2952
|
+
if (!isPrototype(object)) {
|
|
2953
|
+
return result;
|
|
2954
|
+
}
|
|
2955
|
+
return result.filter(key => key !== 'constructor');
|
|
2956
|
+
}
|
|
2957
|
+
function arrayLikeKeys(object) {
|
|
2958
|
+
const indices = times(object.length, index => `${index}`);
|
|
2959
|
+
const filteredKeys = new Set(indices);
|
|
2960
|
+
if (isPromise.isBuffer(object)) {
|
|
2961
|
+
filteredKeys.add('offset');
|
|
2962
|
+
filteredKeys.add('parent');
|
|
2963
|
+
}
|
|
2964
|
+
if (isTypedArray(object)) {
|
|
2965
|
+
filteredKeys.add('buffer');
|
|
2966
|
+
filteredKeys.add('byteLength');
|
|
2967
|
+
filteredKeys.add('byteOffset');
|
|
2968
|
+
}
|
|
2969
|
+
return [...indices, ...Object.keys(object).filter(key => !filteredKeys.has(key))];
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
function assign(object, ...sources) {
|
|
2973
|
+
for (let i = 0; i < sources.length; i++) {
|
|
2974
|
+
assignImpl(object, sources[i]);
|
|
2975
|
+
}
|
|
2976
|
+
return object;
|
|
2977
|
+
}
|
|
2978
|
+
function assignImpl(object, source) {
|
|
2979
|
+
const keys$1 = keys(source);
|
|
2980
|
+
for (let i = 0; i < keys$1.length; i++) {
|
|
2981
|
+
const key = keys$1[i];
|
|
2982
|
+
if (!(key in object) || !isPromise.eq(object[key], source[key])) {
|
|
2983
|
+
object[key] = source[key];
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
function keysIn(object) {
|
|
2989
|
+
if (object == null) {
|
|
2990
|
+
return [];
|
|
2991
|
+
}
|
|
2992
|
+
switch (typeof object) {
|
|
2993
|
+
case 'object':
|
|
2994
|
+
case 'function': {
|
|
2995
|
+
if (isArrayLike(object)) {
|
|
2996
|
+
return arrayLikeKeysIn(object);
|
|
2997
|
+
}
|
|
2998
|
+
if (isPrototype(object)) {
|
|
2999
|
+
return prototypeKeysIn(object);
|
|
3000
|
+
}
|
|
3001
|
+
return keysInImpl(object);
|
|
3002
|
+
}
|
|
3003
|
+
default: {
|
|
3004
|
+
return keysInImpl(Object(object));
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
function keysInImpl(object) {
|
|
3009
|
+
const result = [];
|
|
3010
|
+
for (const key in object) {
|
|
3011
|
+
result.push(key);
|
|
3012
|
+
}
|
|
3013
|
+
return result;
|
|
3014
|
+
}
|
|
3015
|
+
function prototypeKeysIn(object) {
|
|
3016
|
+
const keys = keysInImpl(object);
|
|
3017
|
+
return keys.filter(key => key !== 'constructor');
|
|
3018
|
+
}
|
|
3019
|
+
function arrayLikeKeysIn(object) {
|
|
3020
|
+
const indices = times(object.length, index => `${index}`);
|
|
3021
|
+
const filteredKeys = new Set(indices);
|
|
3022
|
+
if (isPromise.isBuffer(object)) {
|
|
3023
|
+
filteredKeys.add('offset');
|
|
3024
|
+
filteredKeys.add('parent');
|
|
3025
|
+
}
|
|
3026
|
+
if (isTypedArray(object)) {
|
|
3027
|
+
filteredKeys.add('buffer');
|
|
3028
|
+
filteredKeys.add('byteLength');
|
|
3029
|
+
filteredKeys.add('byteOffset');
|
|
3030
|
+
}
|
|
3031
|
+
return [...indices, ...keysInImpl(object).filter(key => !filteredKeys.has(key))];
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
function assignIn(object, ...sources) {
|
|
3035
|
+
for (let i = 0; i < sources.length; i++) {
|
|
3036
|
+
assignInImpl(object, sources[i]);
|
|
3037
|
+
}
|
|
3038
|
+
return object;
|
|
3039
|
+
}
|
|
3040
|
+
function assignInImpl(object, source) {
|
|
3041
|
+
const keys = keysIn(source);
|
|
3042
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3043
|
+
const key = keys[i];
|
|
3044
|
+
if (!(key in object) || !isPromise.eq(object[key], source[key])) {
|
|
3045
|
+
object[key] = source[key];
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
function assignInWith(object, ...sources) {
|
|
3051
|
+
let getValueToAssign = sources[sources.length - 1];
|
|
3052
|
+
if (typeof getValueToAssign === 'function') {
|
|
3053
|
+
sources.pop();
|
|
3054
|
+
}
|
|
3055
|
+
else {
|
|
3056
|
+
getValueToAssign = undefined;
|
|
3057
|
+
}
|
|
3058
|
+
for (let i = 0; i < sources.length; i++) {
|
|
3059
|
+
assignInWithImpl(object, sources[i], getValueToAssign);
|
|
3060
|
+
}
|
|
3061
|
+
return object;
|
|
3062
|
+
}
|
|
3063
|
+
function assignInWithImpl(object, source, getValueToAssign) {
|
|
3064
|
+
const keys = keysIn(source);
|
|
3065
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3066
|
+
const key = keys[i];
|
|
3067
|
+
const objValue = object[key];
|
|
3068
|
+
const srcValue = source[key];
|
|
3069
|
+
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
3070
|
+
if (!(key in object) || !isPromise.eq(objValue, newValue)) {
|
|
3071
|
+
object[key] = newValue;
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
function assignWith(object, ...sources) {
|
|
3077
|
+
let getValueToAssign = sources[sources.length - 1];
|
|
3078
|
+
if (typeof getValueToAssign === 'function') {
|
|
3079
|
+
sources.pop();
|
|
3080
|
+
}
|
|
3081
|
+
else {
|
|
3082
|
+
getValueToAssign = undefined;
|
|
3083
|
+
}
|
|
3084
|
+
for (let i = 0; i < sources.length; i++) {
|
|
3085
|
+
assignWithImpl(object, sources[i], getValueToAssign);
|
|
3086
|
+
}
|
|
3087
|
+
return object;
|
|
3088
|
+
}
|
|
3089
|
+
function assignWithImpl(object, source, getValueToAssign) {
|
|
3090
|
+
const keys$1 = keys(source);
|
|
3091
|
+
for (let i = 0; i < keys$1.length; i++) {
|
|
3092
|
+
const key = keys$1[i];
|
|
3093
|
+
const objValue = object[key];
|
|
3094
|
+
const srcValue = source[key];
|
|
3095
|
+
const newValue = getValueToAssign?.(objValue, srcValue, key, object, source) ?? srcValue;
|
|
3096
|
+
if (!(key in object) || !isPromise.eq(objValue, newValue)) {
|
|
3097
|
+
object[key] = newValue;
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
function create(prototype, properties) {
|
|
3103
|
+
const proto = isObject(prototype) ? Object.create(prototype) : {};
|
|
3104
|
+
if (properties != null) {
|
|
3105
|
+
const propsKeys = keys(properties);
|
|
3106
|
+
for (let i = 0; i < propsKeys.length; i++) {
|
|
3107
|
+
const key = propsKeys[i];
|
|
3108
|
+
const propsValue = properties[key];
|
|
3109
|
+
assignValue(proto, key, propsValue);
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
return proto;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
function defaults(object, ...sources) {
|
|
3116
|
+
object = Object(object);
|
|
3117
|
+
const objectProto = Object.prototype;
|
|
3118
|
+
let length = sources.length;
|
|
3119
|
+
const guard = length > 2 ? sources[2] : undefined;
|
|
3120
|
+
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
3121
|
+
length = 1;
|
|
3122
|
+
}
|
|
3123
|
+
for (let i = 0; i < length; i++) {
|
|
3124
|
+
const source = sources[i];
|
|
3125
|
+
const keys = Object.keys(source);
|
|
3126
|
+
for (let j = 0; j < keys.length; j++) {
|
|
3127
|
+
const key = keys[j];
|
|
3128
|
+
const value = object[key];
|
|
3129
|
+
if (value === undefined ||
|
|
3130
|
+
(!Object.hasOwn(object, key) && isPromise.eq(value, objectProto[key]))) {
|
|
3131
|
+
object[key] = source[key];
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
return object;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
function findKey(obj, predicate) {
|
|
3139
|
+
if (!isObject(obj)) {
|
|
3140
|
+
return undefined;
|
|
3141
|
+
}
|
|
3142
|
+
return findKeyImpl(obj, predicate);
|
|
3143
|
+
}
|
|
3144
|
+
function findKeyImpl(obj, predicate) {
|
|
3145
|
+
if (typeof predicate === 'function') {
|
|
3146
|
+
return findKey$1(obj, predicate);
|
|
3147
|
+
}
|
|
3148
|
+
if (typeof predicate === 'object') {
|
|
3149
|
+
if (Array.isArray(predicate)) {
|
|
3150
|
+
const key = predicate[0];
|
|
3151
|
+
const value = predicate[1];
|
|
3152
|
+
return findKey$1(obj, matchesProperty(key, value));
|
|
3153
|
+
}
|
|
3154
|
+
return findKey$1(obj, matches(predicate));
|
|
3155
|
+
}
|
|
3156
|
+
if (typeof predicate === 'string') {
|
|
3157
|
+
return findKey$1(obj, property(predicate));
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
function forIn(object, iteratee = unary.identity) {
|
|
3162
|
+
if (object == null) {
|
|
3163
|
+
return object;
|
|
3164
|
+
}
|
|
3165
|
+
for (const key in object) {
|
|
3166
|
+
const result = iteratee(object[key], key, object);
|
|
3167
|
+
if (result === false) {
|
|
3168
|
+
break;
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
return object;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
function forInRight(object, iteratee = unary.identity) {
|
|
3175
|
+
if (object == null) {
|
|
3176
|
+
return object;
|
|
3177
|
+
}
|
|
3178
|
+
const keys = [];
|
|
3179
|
+
for (const key in object) {
|
|
3180
|
+
keys.push(key);
|
|
3181
|
+
}
|
|
3182
|
+
for (let i = keys.length - 1; i >= 0; i--) {
|
|
3183
|
+
const key = keys[i];
|
|
3184
|
+
const result = iteratee(object[key], key, object);
|
|
3185
|
+
if (result === false) {
|
|
3186
|
+
break;
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
return object;
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
function forOwn(object, iteratee = unary.identity) {
|
|
3193
|
+
if (object == null) {
|
|
3194
|
+
return object;
|
|
3195
|
+
}
|
|
3196
|
+
const iterable = Object(object);
|
|
3197
|
+
const keys$1 = keys(object);
|
|
3198
|
+
for (let i = 0; i < keys$1.length; ++i) {
|
|
3199
|
+
const key = keys$1[i];
|
|
3200
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
3201
|
+
break;
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
return object;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
function forOwnRight(object, iteratee = unary.identity) {
|
|
3208
|
+
if (object == null) {
|
|
3209
|
+
return object;
|
|
3210
|
+
}
|
|
3211
|
+
const iterable = Object(object);
|
|
3212
|
+
const keys$1 = keys(object);
|
|
3213
|
+
for (let i = keys$1.length - 1; i >= 0; --i) {
|
|
3214
|
+
const key = keys$1[i];
|
|
3215
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
3216
|
+
break;
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
return object;
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
function fromPairs(pairs) {
|
|
3223
|
+
if (!isArrayLike(pairs) && !(pairs instanceof Map)) {
|
|
3224
|
+
return {};
|
|
3225
|
+
}
|
|
3226
|
+
const result = {};
|
|
3227
|
+
for (const [key, value] of pairs) {
|
|
3228
|
+
result[key] = value;
|
|
3229
|
+
}
|
|
3230
|
+
return result;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
function functions(object) {
|
|
3234
|
+
if (object == null) {
|
|
3235
|
+
return [];
|
|
3236
|
+
}
|
|
3237
|
+
return keys(object).filter(key => typeof object[key] === 'function');
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
function functionsIn(object) {
|
|
3241
|
+
if (object == null) {
|
|
3242
|
+
return [];
|
|
3243
|
+
}
|
|
3244
|
+
const result = [];
|
|
3245
|
+
for (const key in object) {
|
|
3246
|
+
if (isPromise.isFunction(object[key])) {
|
|
3247
|
+
result.push(key);
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
return result;
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
function hasIn(object, path) {
|
|
3254
|
+
let resolvedPath;
|
|
3255
|
+
if (Array.isArray(path)) {
|
|
3256
|
+
resolvedPath = path;
|
|
3257
|
+
}
|
|
3258
|
+
else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {
|
|
3259
|
+
resolvedPath = toPath(path);
|
|
3260
|
+
}
|
|
3261
|
+
else {
|
|
3262
|
+
resolvedPath = [path];
|
|
3263
|
+
}
|
|
3264
|
+
if (resolvedPath.length === 0) {
|
|
3265
|
+
return false;
|
|
3266
|
+
}
|
|
3267
|
+
let current = object;
|
|
3268
|
+
for (let i = 0; i < resolvedPath.length; i++) {
|
|
3269
|
+
const key = resolvedPath[i];
|
|
3270
|
+
if (current == null || !(key in Object(current))) {
|
|
3271
|
+
const isSparseIndex = (Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length;
|
|
3272
|
+
if (!isSparseIndex) {
|
|
3273
|
+
return false;
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
current = current[key];
|
|
3277
|
+
}
|
|
3278
|
+
return true;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3281
|
+
function invertBy(object, iteratee) {
|
|
3282
|
+
const result = {};
|
|
3283
|
+
if (isPromise.isNil(object)) {
|
|
3284
|
+
return result;
|
|
3285
|
+
}
|
|
3286
|
+
if (iteratee == null) {
|
|
3287
|
+
iteratee = unary.identity;
|
|
3288
|
+
}
|
|
3289
|
+
const keys = Object.keys(object);
|
|
3290
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3291
|
+
const key = keys[i];
|
|
3292
|
+
const value = object[key];
|
|
3293
|
+
const valueStr = iteratee(value);
|
|
3294
|
+
if (Array.isArray(result[valueStr])) {
|
|
3295
|
+
result[valueStr].push(key);
|
|
3296
|
+
}
|
|
3297
|
+
else {
|
|
3298
|
+
result[valueStr] = [key];
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
return result;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
function mapKeys(object, getNewKey) {
|
|
3305
|
+
getNewKey = getNewKey ?? unary.identity;
|
|
3306
|
+
switch (typeof getNewKey) {
|
|
3307
|
+
case 'string':
|
|
3308
|
+
case 'symbol':
|
|
3309
|
+
case 'number':
|
|
3310
|
+
case 'object': {
|
|
3311
|
+
return mapKeys$1(object, property(getNewKey));
|
|
3312
|
+
}
|
|
3313
|
+
case 'function': {
|
|
3314
|
+
return mapKeys$1(object, getNewKey);
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
function mapValues(object, getNewValue) {
|
|
3320
|
+
getNewValue = getNewValue ?? unary.identity;
|
|
3321
|
+
switch (typeof getNewValue) {
|
|
3322
|
+
case 'string':
|
|
3323
|
+
case 'symbol':
|
|
3324
|
+
case 'number':
|
|
3325
|
+
case 'object': {
|
|
3326
|
+
return mapValues$1(object, property(getNewValue));
|
|
3327
|
+
}
|
|
3328
|
+
case 'function': {
|
|
3329
|
+
return mapValues$1(object, getNewValue);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
function isPlainObject(object) {
|
|
3335
|
+
if (typeof object !== 'object') {
|
|
3336
|
+
return false;
|
|
3337
|
+
}
|
|
3338
|
+
if (object == null) {
|
|
3339
|
+
return false;
|
|
3340
|
+
}
|
|
3341
|
+
if (Object.getPrototypeOf(object) === null) {
|
|
3342
|
+
return true;
|
|
3343
|
+
}
|
|
3344
|
+
if (Object.prototype.toString.call(object) !== '[object Object]') {
|
|
3345
|
+
const tag = object[Symbol.toStringTag];
|
|
3346
|
+
if (tag == null) {
|
|
3347
|
+
return false;
|
|
3348
|
+
}
|
|
3349
|
+
const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;
|
|
3350
|
+
if (isTagReadonly) {
|
|
3351
|
+
return false;
|
|
3352
|
+
}
|
|
3353
|
+
return object.toString() === `[object ${tag}]`;
|
|
3354
|
+
}
|
|
3355
|
+
let proto = object;
|
|
3356
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
3357
|
+
proto = Object.getPrototypeOf(proto);
|
|
3358
|
+
}
|
|
3359
|
+
return Object.getPrototypeOf(object) === proto;
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
function mergeWith(object, ...otherArgs) {
|
|
3363
|
+
const sources = otherArgs.slice(0, -1);
|
|
3364
|
+
const merge = otherArgs[otherArgs.length - 1];
|
|
3365
|
+
let result = object;
|
|
3366
|
+
for (let i = 0; i < sources.length; i++) {
|
|
3367
|
+
const source = sources[i];
|
|
3368
|
+
result = mergeWithDeep(result, source, merge, new Map());
|
|
3369
|
+
}
|
|
3370
|
+
return result;
|
|
3371
|
+
}
|
|
3372
|
+
function mergeWithDeep(target, source, merge, stack) {
|
|
3373
|
+
if (isPromise.isPrimitive(target)) {
|
|
3374
|
+
target = Object(target);
|
|
3375
|
+
}
|
|
3376
|
+
if (source == null || typeof source !== 'object') {
|
|
3377
|
+
return target;
|
|
3378
|
+
}
|
|
3379
|
+
if (stack.has(source)) {
|
|
3380
|
+
return clone(stack.get(source));
|
|
3381
|
+
}
|
|
3382
|
+
stack.set(source, target);
|
|
3383
|
+
if (Array.isArray(source)) {
|
|
3384
|
+
source = source.slice();
|
|
3385
|
+
for (let i = 0; i < source.length; i++) {
|
|
3386
|
+
source[i] = source[i] ?? undefined;
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
const sourceKeys = [...Object.keys(source), ...isPromise.getSymbols(source)];
|
|
3390
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
3391
|
+
const key = sourceKeys[i];
|
|
3392
|
+
let sourceValue = source[key];
|
|
3393
|
+
let targetValue = target[key];
|
|
3394
|
+
if (isArguments(sourceValue)) {
|
|
3395
|
+
sourceValue = { ...sourceValue };
|
|
3396
|
+
}
|
|
3397
|
+
if (isArguments(targetValue)) {
|
|
3398
|
+
targetValue = { ...targetValue };
|
|
3399
|
+
}
|
|
3400
|
+
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(sourceValue)) {
|
|
3401
|
+
sourceValue = cloneDeep(sourceValue);
|
|
3402
|
+
}
|
|
3403
|
+
if (Array.isArray(sourceValue)) {
|
|
3404
|
+
if (typeof targetValue === 'object' && targetValue != null) {
|
|
3405
|
+
const cloned = [];
|
|
3406
|
+
const targetKeys = Reflect.ownKeys(targetValue);
|
|
3407
|
+
for (let i = 0; i < targetKeys.length; i++) {
|
|
3408
|
+
const targetKey = targetKeys[i];
|
|
3409
|
+
cloned[targetKey] = targetValue[targetKey];
|
|
3410
|
+
}
|
|
3411
|
+
targetValue = cloned;
|
|
3412
|
+
}
|
|
3413
|
+
else {
|
|
3414
|
+
targetValue = [];
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
const merged = merge(targetValue, sourceValue, key, target, source, stack);
|
|
3418
|
+
if (merged != null) {
|
|
3419
|
+
target[key] = merged;
|
|
3420
|
+
}
|
|
3421
|
+
else if (Array.isArray(sourceValue)) {
|
|
3422
|
+
target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
|
|
3423
|
+
}
|
|
3424
|
+
else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {
|
|
3425
|
+
target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
|
|
3426
|
+
}
|
|
3427
|
+
else if (targetValue == null && isPlainObject(sourceValue)) {
|
|
3428
|
+
target[key] = mergeWithDeep({}, sourceValue, merge, stack);
|
|
3429
|
+
}
|
|
3430
|
+
else if (targetValue == null && isTypedArray(sourceValue)) {
|
|
3431
|
+
target[key] = cloneDeep(sourceValue);
|
|
3432
|
+
}
|
|
3433
|
+
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
3434
|
+
target[key] = sourceValue;
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
return target;
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
function merge(object, ...sources) {
|
|
3441
|
+
return mergeWith(object, ...sources, noop.noop);
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
function omit(obj, ...keysArr) {
|
|
3445
|
+
if (obj == null) {
|
|
3446
|
+
return {};
|
|
3447
|
+
}
|
|
3448
|
+
const result = cloneDeep$1(obj);
|
|
3449
|
+
for (let i = 0; i < keysArr.length; i++) {
|
|
3450
|
+
let keys = keysArr[i];
|
|
3451
|
+
switch (typeof keys) {
|
|
3452
|
+
case 'object': {
|
|
3453
|
+
if (!Array.isArray(keys)) {
|
|
3454
|
+
keys = Array.from(keys);
|
|
3455
|
+
}
|
|
3456
|
+
for (let j = 0; j < keys.length; j++) {
|
|
3457
|
+
const key = keys[j];
|
|
3458
|
+
unset(result, key);
|
|
3459
|
+
}
|
|
3460
|
+
break;
|
|
3461
|
+
}
|
|
3462
|
+
case 'string':
|
|
3463
|
+
case 'symbol':
|
|
3464
|
+
case 'number': {
|
|
3465
|
+
unset(result, keys);
|
|
3466
|
+
break;
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
return result;
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
function pick(obj, ...keysArr) {
|
|
3474
|
+
if (isNil(obj)) {
|
|
3475
|
+
return {};
|
|
3476
|
+
}
|
|
3477
|
+
const result = {};
|
|
3478
|
+
for (let i = 0; i < keysArr.length; i++) {
|
|
3479
|
+
let keys = keysArr[i];
|
|
3480
|
+
switch (typeof keys) {
|
|
3481
|
+
case 'object': {
|
|
3482
|
+
if (!Array.isArray(keys)) {
|
|
3483
|
+
if (isArrayLike(keys)) {
|
|
3484
|
+
keys = Array.from(keys);
|
|
3485
|
+
}
|
|
3486
|
+
else {
|
|
3487
|
+
keys = [keys];
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
break;
|
|
3491
|
+
}
|
|
3492
|
+
case 'string':
|
|
3493
|
+
case 'symbol':
|
|
3494
|
+
case 'number': {
|
|
3495
|
+
keys = [keys];
|
|
3496
|
+
break;
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
for (const key of keys) {
|
|
3500
|
+
const value = get(obj, key);
|
|
3501
|
+
if (value === undefined && !has(obj, key)) {
|
|
3502
|
+
continue;
|
|
3503
|
+
}
|
|
3504
|
+
if (typeof key === 'string' && Object.hasOwn(obj, key)) {
|
|
3505
|
+
result[key] = value;
|
|
3506
|
+
}
|
|
3507
|
+
else {
|
|
3508
|
+
set(result, key, value);
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
return result;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
function getSymbolsIn(object) {
|
|
3516
|
+
const result = [];
|
|
3517
|
+
while (object) {
|
|
3518
|
+
result.push(...isPromise.getSymbols(object));
|
|
3519
|
+
object = Object.getPrototypeOf(object);
|
|
3520
|
+
}
|
|
3521
|
+
return result;
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
function pickBy(obj, shouldPick) {
|
|
3525
|
+
if (obj == null) {
|
|
3526
|
+
return {};
|
|
3527
|
+
}
|
|
3528
|
+
const result = {};
|
|
3529
|
+
if (shouldPick == null) {
|
|
3530
|
+
return obj;
|
|
3531
|
+
}
|
|
3532
|
+
const keys = isArrayLike(obj) ? range$1.range(0, obj.length) : [...keysIn(obj), ...getSymbolsIn(obj)];
|
|
3533
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3534
|
+
const key = (zip$1.isSymbol(keys[i]) ? keys[i] : keys[i].toString());
|
|
3535
|
+
const value = obj[key];
|
|
3536
|
+
if (shouldPick(value, key, obj)) {
|
|
3537
|
+
result[key] = value;
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3540
|
+
return result;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
function propertyOf(object) {
|
|
3544
|
+
return function (path) {
|
|
3545
|
+
return get(object, path);
|
|
3546
|
+
};
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
function toDefaulted(object, ...sources) {
|
|
3550
|
+
const cloned = cloneDeep(object);
|
|
3551
|
+
return defaults(cloned, ...sources);
|
|
3552
|
+
}
|
|
3553
|
+
|
|
3554
|
+
function mapToEntries(map) {
|
|
3555
|
+
const arr = new Array(map.size);
|
|
3556
|
+
const keys = map.keys();
|
|
3557
|
+
const values = map.values();
|
|
3558
|
+
for (let i = 0; i < arr.length; i++) {
|
|
3559
|
+
arr[i] = [keys.next().value, values.next().value];
|
|
3560
|
+
}
|
|
3561
|
+
return arr;
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
function setToEntries(set) {
|
|
3565
|
+
const arr = new Array(set.size);
|
|
3566
|
+
const values = set.values();
|
|
3567
|
+
for (let i = 0; i < arr.length; i++) {
|
|
3568
|
+
const value = values.next().value;
|
|
3569
|
+
arr[i] = [value, value];
|
|
3570
|
+
}
|
|
3571
|
+
return arr;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
function toPairs(object) {
|
|
3575
|
+
if (object instanceof Set) {
|
|
3576
|
+
return setToEntries(object);
|
|
3577
|
+
}
|
|
3578
|
+
if (object instanceof Map) {
|
|
3579
|
+
return mapToEntries(object);
|
|
3580
|
+
}
|
|
3581
|
+
const keys$1 = keys(object);
|
|
3582
|
+
const result = new Array(keys$1.length);
|
|
3583
|
+
for (let i = 0; i < keys$1.length; i++) {
|
|
3584
|
+
const key = keys$1[i];
|
|
3585
|
+
const value = object[key];
|
|
3586
|
+
result[i] = [key, value];
|
|
3587
|
+
}
|
|
3588
|
+
return result;
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
function toPairsIn(object) {
|
|
3592
|
+
if (object instanceof Set) {
|
|
3593
|
+
return setToEntries(object);
|
|
3594
|
+
}
|
|
3595
|
+
if (object instanceof Map) {
|
|
3596
|
+
return mapToEntries(object);
|
|
3597
|
+
}
|
|
3598
|
+
const keys = keysIn(object);
|
|
3599
|
+
const result = new Array(keys.length);
|
|
3600
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3601
|
+
const key = keys[i];
|
|
3602
|
+
const value = object[key];
|
|
3603
|
+
result[i] = [key, value];
|
|
3604
|
+
}
|
|
3605
|
+
return result;
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
function update(obj, path, updater) {
|
|
3609
|
+
return updateWith(obj, path, updater, () => undefined);
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
function values(object) {
|
|
3613
|
+
return Object.values(object);
|
|
3614
|
+
}
|
|
3615
|
+
|
|
3616
|
+
function valuesIn(object) {
|
|
3617
|
+
const keys = keysIn(object);
|
|
3618
|
+
const result = new Array(keys.length);
|
|
3619
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3620
|
+
const key = keys[i];
|
|
3621
|
+
result[i] = object[key];
|
|
3622
|
+
}
|
|
3623
|
+
return result;
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
function conformsTo(target, source) {
|
|
3627
|
+
if (source == null) {
|
|
3628
|
+
return true;
|
|
3629
|
+
}
|
|
3630
|
+
if (target == null) {
|
|
3631
|
+
return Object.keys(source).length === 0;
|
|
3632
|
+
}
|
|
3633
|
+
const keys = Object.keys(source);
|
|
3634
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3635
|
+
const key = keys[i];
|
|
3636
|
+
const predicate = source[key];
|
|
3637
|
+
const value = target[key];
|
|
3638
|
+
if ((value === undefined && !(key in target)) || !predicate(value)) {
|
|
3639
|
+
return false;
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
return true;
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
function conforms(source) {
|
|
3646
|
+
source = cloneDeep$1(source);
|
|
3647
|
+
return function (object) {
|
|
3648
|
+
return conformsTo(object, source);
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
function isArrayBuffer(value) {
|
|
3653
|
+
return isPromise.isArrayBuffer(value);
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
function isBoolean(value) {
|
|
3657
|
+
return typeof value === 'boolean' || value instanceof Boolean;
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
function isBuffer(x) {
|
|
3661
|
+
return isPromise.isBuffer(x);
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
function isDate(value) {
|
|
3665
|
+
return isPromise.isDate(value);
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
function isElement(value) {
|
|
3669
|
+
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
function isEmpty(value) {
|
|
3673
|
+
if (value == null) {
|
|
3674
|
+
return true;
|
|
3675
|
+
}
|
|
3676
|
+
if (isArrayLike(value)) {
|
|
3677
|
+
if (typeof value.splice !== 'function' &&
|
|
3678
|
+
typeof value !== 'string' &&
|
|
3679
|
+
(typeof Buffer === 'undefined' || !Buffer.isBuffer(value)) &&
|
|
3680
|
+
!isTypedArray(value) &&
|
|
3681
|
+
!isArguments(value)) {
|
|
3682
|
+
return false;
|
|
3683
|
+
}
|
|
3684
|
+
return value.length === 0;
|
|
3685
|
+
}
|
|
3686
|
+
if (typeof value === 'object') {
|
|
3687
|
+
if (value instanceof Map || value instanceof Set) {
|
|
3688
|
+
return value.size === 0;
|
|
3689
|
+
}
|
|
3690
|
+
const keys = Object.keys(value);
|
|
3691
|
+
if (isPrototype(value)) {
|
|
3692
|
+
return keys.filter(x => x !== 'constructor').length === 0;
|
|
3693
|
+
}
|
|
3694
|
+
return keys.length === 0;
|
|
3695
|
+
}
|
|
3696
|
+
return true;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
function isEqualWith(a, b, areValuesEqual = noop.noop) {
|
|
3700
|
+
if (typeof areValuesEqual !== 'function') {
|
|
3701
|
+
areValuesEqual = noop.noop;
|
|
3702
|
+
}
|
|
3703
|
+
return isPromise.isEqualWith(a, b, (...args) => {
|
|
3704
|
+
const result = areValuesEqual(...args);
|
|
3705
|
+
if (result !== undefined) {
|
|
3706
|
+
return Boolean(result);
|
|
3707
|
+
}
|
|
3708
|
+
if (a instanceof Map && b instanceof Map) {
|
|
3709
|
+
return isEqualWith(Array.from(a), Array.from(b), unary.after(2, areValuesEqual));
|
|
3710
|
+
}
|
|
3711
|
+
if (a instanceof Set && b instanceof Set) {
|
|
3712
|
+
return isEqualWith(Array.from(a), Array.from(b), unary.after(2, areValuesEqual));
|
|
3713
|
+
}
|
|
3714
|
+
});
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
function isError(value) {
|
|
3718
|
+
return isPromise.getTag(value) === '[object Error]';
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
function isFinite(value) {
|
|
3722
|
+
return Number.isFinite(value);
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
function isInteger(value) {
|
|
3726
|
+
return Number.isInteger(value);
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
function isMap(value) {
|
|
3730
|
+
return isPromise.isMap(value);
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
function isRegExp(value) {
|
|
3734
|
+
return isPromise.isRegExp(value);
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
function isSafeInteger(value) {
|
|
3738
|
+
return Number.isSafeInteger(value);
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
function isSet(value) {
|
|
3742
|
+
return isPromise.isSet(value);
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
function isWeakMap(value) {
|
|
3746
|
+
return isPromise.isWeakMap(value);
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
function isWeakSet(value) {
|
|
3750
|
+
return isPromise.isWeakSet(value);
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
function normalizeForCase(str) {
|
|
3754
|
+
if (typeof str !== 'string') {
|
|
3755
|
+
str = toString(str);
|
|
3756
|
+
}
|
|
3757
|
+
return str.replace(/['\u2019]/g, '');
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
function camelCase(str) {
|
|
3761
|
+
return reverseString.camelCase(normalizeForCase(str));
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
function deburr(str) {
|
|
3765
|
+
return reverseString.deburr(toString(str));
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
function endsWith(str, target, position = str.length) {
|
|
3769
|
+
return str.endsWith(target, position);
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
function escape(string) {
|
|
3773
|
+
return reverseString.escape(toString(string));
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
function escapeRegExp(str) {
|
|
3777
|
+
return reverseString.escapeRegExp(toString(str));
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
function kebabCase(str) {
|
|
3781
|
+
return reverseString.kebabCase(normalizeForCase(str));
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
function lowerCase(str) {
|
|
3785
|
+
return reverseString.lowerCase(normalizeForCase(str));
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
function lowerFirst(str) {
|
|
3789
|
+
return reverseString.lowerFirst(toString(str));
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
function pad(str, length, chars = ' ') {
|
|
3793
|
+
return reverseString.pad(toString(str), length, chars);
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
function padEnd(str, length = 0, chars = ' ') {
|
|
3797
|
+
return toString(str).padEnd(length, chars);
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
function padStart(str, length = 0, chars = ' ') {
|
|
3801
|
+
return toString(str).padStart(length, chars);
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
function repeat(str, n, guard) {
|
|
3805
|
+
if (guard ? isIterateeCall(str, n, guard) : n === undefined) {
|
|
3806
|
+
n = 1;
|
|
3807
|
+
}
|
|
3808
|
+
else {
|
|
3809
|
+
n = zip$1.toInteger(n);
|
|
3810
|
+
}
|
|
3811
|
+
return toString(str).repeat(n);
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
function replace(target = '', pattern, replacement) {
|
|
3815
|
+
if (arguments.length < 3) {
|
|
3816
|
+
return toString(target);
|
|
3817
|
+
}
|
|
3818
|
+
return toString(target).replace(pattern, replacement);
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3821
|
+
function snakeCase(str) {
|
|
3822
|
+
return reverseString.snakeCase(normalizeForCase(str));
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
function split(string = '', separator, limit) {
|
|
3826
|
+
return toString(string).split(separator, limit);
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
function startCase(str) {
|
|
3830
|
+
const words = reverseString.words(normalizeForCase(str).trim());
|
|
3831
|
+
let result = '';
|
|
3832
|
+
for (let i = 0; i < words.length; i++) {
|
|
3833
|
+
const word = words[i];
|
|
3834
|
+
if (result) {
|
|
3835
|
+
result += ' ';
|
|
3836
|
+
}
|
|
3837
|
+
if (word === word.toUpperCase()) {
|
|
3838
|
+
result += word;
|
|
3839
|
+
}
|
|
3840
|
+
else {
|
|
3841
|
+
result += word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
return result;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
function startsWith(str, target, position = 0) {
|
|
3848
|
+
return str.startsWith(target, position);
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
const esTemplateRegExp = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
|
3852
|
+
const unEscapedRegExp = /['\n\r\u2028\u2029\\]/g;
|
|
3853
|
+
const noMatchExp = /($^)/;
|
|
3854
|
+
const escapeMap = new Map([
|
|
3855
|
+
['\\', '\\'],
|
|
3856
|
+
["'", "'"],
|
|
3857
|
+
['\n', 'n'],
|
|
3858
|
+
['\r', 'r'],
|
|
3859
|
+
['\u2028', 'u2028'],
|
|
3860
|
+
['\u2029', 'u2029'],
|
|
3861
|
+
]);
|
|
3862
|
+
function escapeString(match) {
|
|
3863
|
+
return `\\${escapeMap.get(match)}`;
|
|
3864
|
+
}
|
|
3865
|
+
const templateSettings = {
|
|
3866
|
+
escape: /<%-([\s\S]+?)%>/g,
|
|
3867
|
+
evaluate: /<%([\s\S]+?)%>/g,
|
|
3868
|
+
interpolate: /<%=([\s\S]+?)%>/g,
|
|
3869
|
+
variable: '',
|
|
3870
|
+
imports: {
|
|
3871
|
+
_: {
|
|
3872
|
+
escape,
|
|
3873
|
+
template,
|
|
3874
|
+
},
|
|
3875
|
+
},
|
|
3876
|
+
};
|
|
3877
|
+
function template(string, options, guard) {
|
|
3878
|
+
string = toString(string);
|
|
3879
|
+
if (guard) {
|
|
3880
|
+
options = templateSettings;
|
|
3881
|
+
}
|
|
3882
|
+
options = defaults({ ...options }, templateSettings);
|
|
3883
|
+
const delimitersRegExp = new RegExp([
|
|
3884
|
+
options.escape?.source ?? noMatchExp.source,
|
|
3885
|
+
options.interpolate?.source ?? noMatchExp.source,
|
|
3886
|
+
options.interpolate ? esTemplateRegExp.source : noMatchExp.source,
|
|
3887
|
+
options.evaluate?.source ?? noMatchExp.source,
|
|
3888
|
+
'$',
|
|
3889
|
+
].join('|'), 'g');
|
|
3890
|
+
let lastIndex = 0;
|
|
3891
|
+
let isEvaluated = false;
|
|
3892
|
+
let source = `__p += ''`;
|
|
3893
|
+
for (const match of string.matchAll(delimitersRegExp)) {
|
|
3894
|
+
const [fullMatch, escapeValue, interpolateValue, esTemplateValue, evaluateValue] = match;
|
|
3895
|
+
const { index } = match;
|
|
3896
|
+
source += ` + '${string.slice(lastIndex, index).replace(unEscapedRegExp, escapeString)}'`;
|
|
3897
|
+
if (escapeValue) {
|
|
3898
|
+
source += ` + _.escape(${escapeValue})`;
|
|
3899
|
+
}
|
|
3900
|
+
if (interpolateValue) {
|
|
3901
|
+
source += ` + ((${interpolateValue}) == null ? '' : ${interpolateValue})`;
|
|
3902
|
+
}
|
|
3903
|
+
else if (esTemplateValue) {
|
|
3904
|
+
source += ` + ((${esTemplateValue}) == null ? '' : ${esTemplateValue})`;
|
|
3905
|
+
}
|
|
3906
|
+
if (evaluateValue) {
|
|
3907
|
+
source += `;\n${evaluateValue};\n __p += ''`;
|
|
3908
|
+
isEvaluated = true;
|
|
3909
|
+
}
|
|
3910
|
+
lastIndex = index + fullMatch.length;
|
|
3911
|
+
}
|
|
3912
|
+
const imports = defaults({ ...options.imports }, templateSettings.imports);
|
|
3913
|
+
const importsKeys = Object.keys(imports);
|
|
3914
|
+
const importValues = Object.values(imports);
|
|
3915
|
+
const sourceURL = `//# sourceURL=${options.sourceURL ? String(options.sourceURL).replace(/[\r\n]/g, ' ') : `es-toolkit.templateSource[${Date.now()}]`}\n`;
|
|
3916
|
+
const compiledFunction = `function(${options.variable || 'obj'}) {
|
|
3917
|
+
let __p = '';
|
|
3918
|
+
${options.variable ? '' : 'if (obj == null) { obj = {}; }'}
|
|
3919
|
+
${isEvaluated ? `function print() { __p += Array.prototype.join.call(arguments, ''); }` : ''}
|
|
3920
|
+
${options.variable ? source : `with(obj) {\n${source}\n}`}
|
|
3921
|
+
return __p;
|
|
3922
|
+
}`;
|
|
3923
|
+
const result = attempt(() => new Function(...importsKeys, `${sourceURL}return ${compiledFunction}`)(...importValues));
|
|
3924
|
+
result.source = compiledFunction;
|
|
3925
|
+
if (result instanceof Error) {
|
|
3926
|
+
throw result;
|
|
3927
|
+
}
|
|
3928
|
+
return result;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
function toLower(value) {
|
|
3932
|
+
return toString(value).toLowerCase();
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
function toUpper(value) {
|
|
3936
|
+
return toString(value).toUpperCase();
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
function trim(str, chars, guard) {
|
|
3940
|
+
if (str == null) {
|
|
3941
|
+
return '';
|
|
3942
|
+
}
|
|
3943
|
+
if (guard != null || chars == null) {
|
|
3944
|
+
return str.toString().trim();
|
|
3945
|
+
}
|
|
3946
|
+
switch (typeof chars) {
|
|
3947
|
+
case 'string': {
|
|
3948
|
+
return reverseString.trim(str, chars.toString().split(''));
|
|
3949
|
+
}
|
|
3950
|
+
case 'object': {
|
|
3951
|
+
if (Array.isArray(chars)) {
|
|
3952
|
+
return reverseString.trim(str, chars.flatMap(x => x.toString().split('')));
|
|
3953
|
+
}
|
|
3954
|
+
else {
|
|
3955
|
+
return reverseString.trim(str, chars.toString().split(''));
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3961
|
+
function trimEnd(str, chars, guard) {
|
|
3962
|
+
if (str == null) {
|
|
3963
|
+
return '';
|
|
3964
|
+
}
|
|
3965
|
+
if (guard != null || chars == null) {
|
|
3966
|
+
return str.toString().trimEnd();
|
|
3967
|
+
}
|
|
3968
|
+
switch (typeof chars) {
|
|
3969
|
+
case 'string': {
|
|
3970
|
+
return reverseString.trimEnd(str, chars.toString().split(''));
|
|
3971
|
+
}
|
|
3972
|
+
case 'object': {
|
|
3973
|
+
if (Array.isArray(chars)) {
|
|
3974
|
+
return reverseString.trimEnd(str, chars.flatMap(x => x.toString().split('')));
|
|
3975
|
+
}
|
|
3976
|
+
else {
|
|
3977
|
+
return reverseString.trimEnd(str, chars.toString().split(''));
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
function trimStart(str, chars, guard) {
|
|
3984
|
+
if (str == null) {
|
|
3985
|
+
return '';
|
|
3986
|
+
}
|
|
3987
|
+
if (guard != null || chars == null) {
|
|
3988
|
+
return str.toString().trimStart();
|
|
3989
|
+
}
|
|
3990
|
+
switch (typeof chars) {
|
|
3991
|
+
case 'string': {
|
|
3992
|
+
return reverseString.trimStart(str, chars.toString().split(''));
|
|
3993
|
+
}
|
|
3994
|
+
case 'object': {
|
|
3995
|
+
if (Array.isArray(chars)) {
|
|
3996
|
+
return reverseString.trimStart(str, chars.flatMap(x => x.toString().split('')));
|
|
3997
|
+
}
|
|
3998
|
+
else {
|
|
3999
|
+
return reverseString.trimStart(str, chars.toString().split(''));
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
function unescape(str) {
|
|
4006
|
+
return reverseString.unescape(toString(str));
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
function upperCase(str) {
|
|
4010
|
+
return reverseString.upperCase(normalizeForCase(str));
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
function upperFirst(str) {
|
|
4014
|
+
return reverseString.upperFirst(toString(str));
|
|
4015
|
+
}
|
|
4016
|
+
|
|
4017
|
+
function words(str, pattern = reverseString.CASE_SPLIT_PATTERN, guard) {
|
|
4018
|
+
const input = toString(str);
|
|
4019
|
+
pattern = guard ? reverseString.CASE_SPLIT_PATTERN : pattern;
|
|
4020
|
+
const words = Array.from(input.match(pattern) ?? []);
|
|
4021
|
+
return words.filter(x => x !== '');
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
function cond(pairs) {
|
|
4025
|
+
const length = pairs.length;
|
|
4026
|
+
const processedPairs = pairs.map(pair => {
|
|
4027
|
+
const predicate = pair[0];
|
|
4028
|
+
const func = pair[1];
|
|
4029
|
+
if (!isPromise.isFunction(func)) {
|
|
4030
|
+
throw new TypeError('Expected a function');
|
|
4031
|
+
}
|
|
4032
|
+
return [iteratee(predicate), func];
|
|
4033
|
+
});
|
|
4034
|
+
return function (...args) {
|
|
4035
|
+
for (let i = 0; i < length; i++) {
|
|
4036
|
+
const pair = processedPairs[i];
|
|
4037
|
+
const predicate = pair[0];
|
|
4038
|
+
const func = pair[1];
|
|
4039
|
+
if (predicate.apply(this, args)) {
|
|
4040
|
+
return func.apply(this, args);
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
};
|
|
4044
|
+
}
|
|
4045
|
+
|
|
4046
|
+
function constant(value) {
|
|
4047
|
+
return () => value;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
function defaultTo(value, defaultValue) {
|
|
4051
|
+
if (value == null || Number.isNaN(value)) {
|
|
4052
|
+
return defaultValue;
|
|
4053
|
+
}
|
|
4054
|
+
return value;
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
function gt(value, other) {
|
|
4058
|
+
if (typeof value === 'string' && typeof other === 'string') {
|
|
4059
|
+
return value > other;
|
|
4060
|
+
}
|
|
4061
|
+
return zip$1.toNumber(value) > zip$1.toNumber(other);
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
function gte(value, other) {
|
|
4065
|
+
if (typeof value === 'string' && typeof other === 'string') {
|
|
4066
|
+
return value >= other;
|
|
4067
|
+
}
|
|
4068
|
+
return zip$1.toNumber(value) >= zip$1.toNumber(other);
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
function invoke(object, path, args = []) {
|
|
4072
|
+
if (object == null) {
|
|
4073
|
+
return;
|
|
4074
|
+
}
|
|
4075
|
+
switch (typeof path) {
|
|
4076
|
+
case 'string': {
|
|
4077
|
+
if (typeof object === 'object' && Object.hasOwn(object, path)) {
|
|
4078
|
+
return invokeImpl(object, [path], args);
|
|
4079
|
+
}
|
|
4080
|
+
return invokeImpl(object, toPath(path), args);
|
|
4081
|
+
}
|
|
4082
|
+
case 'number':
|
|
4083
|
+
case 'symbol': {
|
|
4084
|
+
return invokeImpl(object, [path], args);
|
|
4085
|
+
}
|
|
4086
|
+
default: {
|
|
4087
|
+
if (Array.isArray(path)) {
|
|
4088
|
+
return invokeImpl(object, path, args);
|
|
4089
|
+
}
|
|
4090
|
+
else {
|
|
4091
|
+
return invokeImpl(object, [path], args);
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
function invokeImpl(object, path, args) {
|
|
4097
|
+
const parent = get(object, path.slice(0, -1), object);
|
|
4098
|
+
if (parent == null) {
|
|
4099
|
+
return undefined;
|
|
4100
|
+
}
|
|
4101
|
+
let lastKey = last(path);
|
|
4102
|
+
const lastValue = lastKey?.valueOf();
|
|
4103
|
+
if (typeof lastValue === 'number') {
|
|
4104
|
+
lastKey = toKey(lastValue);
|
|
4105
|
+
}
|
|
4106
|
+
else {
|
|
4107
|
+
lastKey = String(lastKey);
|
|
4108
|
+
}
|
|
4109
|
+
const func = get(parent, lastKey);
|
|
4110
|
+
return func?.apply(parent, args);
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
function lt(value, other) {
|
|
4114
|
+
if (typeof value === 'string' && typeof other === 'string') {
|
|
4115
|
+
return value < other;
|
|
4116
|
+
}
|
|
4117
|
+
return zip$1.toNumber(value) < zip$1.toNumber(other);
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
function lte(value, other) {
|
|
4121
|
+
if (typeof value === 'string' && typeof other === 'string') {
|
|
4122
|
+
return value <= other;
|
|
4123
|
+
}
|
|
4124
|
+
return zip$1.toNumber(value) <= zip$1.toNumber(other);
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4127
|
+
function method(path, ...args) {
|
|
4128
|
+
return function (object) {
|
|
4129
|
+
return invoke(object, path, args);
|
|
4130
|
+
};
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
function methodOf(object, ...args) {
|
|
4134
|
+
return function (path) {
|
|
4135
|
+
return invoke(object, path, args);
|
|
4136
|
+
};
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
function now() {
|
|
4140
|
+
return Date.now();
|
|
4141
|
+
}
|
|
4142
|
+
|
|
4143
|
+
function over(...iteratees) {
|
|
4144
|
+
if (iteratees.length === 1 && Array.isArray(iteratees[0])) {
|
|
4145
|
+
iteratees = iteratees[0];
|
|
4146
|
+
}
|
|
4147
|
+
const funcs = iteratees.map(item => iteratee(item));
|
|
4148
|
+
return function (...args) {
|
|
4149
|
+
return funcs.map(func => func.apply(this, args));
|
|
4150
|
+
};
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
function overEvery(...predicates) {
|
|
4154
|
+
return function (...values) {
|
|
4155
|
+
for (let i = 0; i < predicates.length; ++i) {
|
|
4156
|
+
const predicate = predicates[i];
|
|
4157
|
+
if (!Array.isArray(predicate)) {
|
|
4158
|
+
if (!iteratee(predicate).apply(this, values)) {
|
|
4159
|
+
return false;
|
|
4160
|
+
}
|
|
4161
|
+
continue;
|
|
4162
|
+
}
|
|
4163
|
+
for (let j = 0; j < predicate.length; ++j) {
|
|
4164
|
+
if (!iteratee(predicate[j]).apply(this, values)) {
|
|
4165
|
+
return false;
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
return true;
|
|
4170
|
+
};
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4173
|
+
function overSome(...predicates) {
|
|
4174
|
+
return function (...values) {
|
|
4175
|
+
for (let i = 0; i < predicates.length; ++i) {
|
|
4176
|
+
const predicate = predicates[i];
|
|
4177
|
+
if (!Array.isArray(predicate)) {
|
|
4178
|
+
if (iteratee(predicate).apply(this, values)) {
|
|
4179
|
+
return true;
|
|
4180
|
+
}
|
|
4181
|
+
continue;
|
|
4182
|
+
}
|
|
4183
|
+
for (let j = 0; j < predicate.length; ++j) {
|
|
4184
|
+
if (iteratee(predicate[j]).apply(this, values)) {
|
|
4185
|
+
return true;
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
}
|
|
4189
|
+
return false;
|
|
4190
|
+
};
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
function stubArray() {
|
|
4194
|
+
return [];
|
|
4195
|
+
}
|
|
4196
|
+
|
|
4197
|
+
function stubFalse() {
|
|
4198
|
+
return false;
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
function stubObject() {
|
|
4202
|
+
return {};
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
function stubString() {
|
|
4206
|
+
return '';
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
function stubTrue() {
|
|
4210
|
+
return true;
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
function toArray(value) {
|
|
4214
|
+
if (value == null) {
|
|
4215
|
+
return [];
|
|
4216
|
+
}
|
|
4217
|
+
if (isArrayLike(value) || isMap(value)) {
|
|
4218
|
+
return Array.from(value);
|
|
4219
|
+
}
|
|
4220
|
+
if (typeof value === 'object') {
|
|
4221
|
+
return Object.values(value);
|
|
4222
|
+
}
|
|
4223
|
+
return [];
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
const MAX_ARRAY_LENGTH = 4_294_967_295;
|
|
4227
|
+
|
|
4228
|
+
function toLength(value) {
|
|
4229
|
+
if (value == null) {
|
|
4230
|
+
return 0;
|
|
4231
|
+
}
|
|
4232
|
+
const length = Math.floor(Number(value));
|
|
4233
|
+
return clamp(length, 0, MAX_ARRAY_LENGTH);
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
function toPlainObject(value) {
|
|
4237
|
+
const plainObject = {};
|
|
4238
|
+
const valueKeys = keysIn(value);
|
|
4239
|
+
for (let i = 0; i < valueKeys.length; i++) {
|
|
4240
|
+
const key = valueKeys[i];
|
|
4241
|
+
const objValue = value[key];
|
|
4242
|
+
if (key === '__proto__') {
|
|
4243
|
+
Object.defineProperty(plainObject, key, {
|
|
4244
|
+
configurable: true,
|
|
4245
|
+
enumerable: true,
|
|
4246
|
+
value: objValue,
|
|
4247
|
+
writable: true,
|
|
4248
|
+
});
|
|
4249
|
+
}
|
|
4250
|
+
else {
|
|
4251
|
+
plainObject[key] = objValue;
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
return plainObject;
|
|
4255
|
+
}
|
|
4256
|
+
|
|
4257
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
4258
|
+
|
|
4259
|
+
function toSafeInteger(value) {
|
|
4260
|
+
if (value == null) {
|
|
4261
|
+
return 0;
|
|
4262
|
+
}
|
|
4263
|
+
return clamp(zip$1.toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4266
|
+
let idCounter = 0;
|
|
4267
|
+
function uniqueId(prefix = '') {
|
|
4268
|
+
const id = ++idCounter;
|
|
4269
|
+
return `${prefix}${id}`;
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
const compat = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
4273
|
+
__proto__: null,
|
|
4274
|
+
AbortError: AbortError.AbortError,
|
|
4275
|
+
Mutex: promise_index.Mutex,
|
|
4276
|
+
Semaphore: promise_index.Semaphore,
|
|
4277
|
+
TimeoutError: error_index.TimeoutError,
|
|
4278
|
+
add,
|
|
4279
|
+
after,
|
|
4280
|
+
ary,
|
|
4281
|
+
assign,
|
|
4282
|
+
assignIn,
|
|
4283
|
+
assignInWith,
|
|
4284
|
+
assignWith,
|
|
4285
|
+
asyncNoop: unary.asyncNoop,
|
|
4286
|
+
at,
|
|
4287
|
+
attempt,
|
|
4288
|
+
attemptAsync: invariant.attemptAsync,
|
|
4289
|
+
before,
|
|
4290
|
+
bind,
|
|
4291
|
+
bindKey,
|
|
4292
|
+
camelCase,
|
|
4293
|
+
capitalize: reverseString.capitalize,
|
|
4294
|
+
castArray,
|
|
4295
|
+
ceil,
|
|
4296
|
+
chunk,
|
|
4297
|
+
clamp,
|
|
4298
|
+
clone,
|
|
4299
|
+
cloneDeep,
|
|
4300
|
+
cloneDeepWith,
|
|
4301
|
+
compact,
|
|
4302
|
+
concat,
|
|
4303
|
+
cond,
|
|
4304
|
+
conforms,
|
|
4305
|
+
conformsTo,
|
|
4306
|
+
constant,
|
|
4307
|
+
constantCase: reverseString.constantCase,
|
|
4308
|
+
countBy: zip$1.countBy,
|
|
4309
|
+
create,
|
|
4310
|
+
curry,
|
|
4311
|
+
curryRight,
|
|
4312
|
+
debounce,
|
|
4313
|
+
deburr,
|
|
4314
|
+
defaultTo,
|
|
4315
|
+
defaults,
|
|
4316
|
+
defer,
|
|
4317
|
+
delay,
|
|
4318
|
+
difference,
|
|
4319
|
+
differenceBy,
|
|
4320
|
+
differenceWith,
|
|
4321
|
+
divide,
|
|
4322
|
+
drop,
|
|
4323
|
+
dropRight,
|
|
4324
|
+
dropRightWhile,
|
|
4325
|
+
dropWhile,
|
|
4326
|
+
each: forEach,
|
|
4327
|
+
eachRight: forEachRight,
|
|
4328
|
+
endsWith,
|
|
4329
|
+
eq: isPromise.eq,
|
|
4330
|
+
escape,
|
|
4331
|
+
escapeRegExp,
|
|
4332
|
+
every,
|
|
4333
|
+
extend: assignIn,
|
|
4334
|
+
extendWith: assignInWith,
|
|
4335
|
+
fill,
|
|
4336
|
+
filter,
|
|
4337
|
+
find,
|
|
4338
|
+
findIndex,
|
|
4339
|
+
findKey,
|
|
4340
|
+
findLast,
|
|
4341
|
+
findLastIndex,
|
|
4342
|
+
first: head,
|
|
4343
|
+
flatMap,
|
|
4344
|
+
flatMapDeep: zip$1.flatMapDeep,
|
|
4345
|
+
flatten,
|
|
4346
|
+
flattenDeep,
|
|
4347
|
+
flattenDepth,
|
|
4348
|
+
flattenObject,
|
|
4349
|
+
flip,
|
|
4350
|
+
floor,
|
|
4351
|
+
flow,
|
|
4352
|
+
flowRight,
|
|
4353
|
+
forEach,
|
|
4354
|
+
forEachRight,
|
|
4355
|
+
forIn,
|
|
4356
|
+
forInRight,
|
|
4357
|
+
forOwn,
|
|
4358
|
+
forOwnRight,
|
|
4359
|
+
fromPairs,
|
|
4360
|
+
functions,
|
|
4361
|
+
functionsIn,
|
|
4362
|
+
get,
|
|
4363
|
+
groupBy,
|
|
4364
|
+
gt,
|
|
4365
|
+
gte,
|
|
4366
|
+
has,
|
|
4367
|
+
hasIn,
|
|
4368
|
+
head,
|
|
4369
|
+
identity: unary.identity,
|
|
4370
|
+
inRange,
|
|
4371
|
+
includes,
|
|
4372
|
+
indexOf,
|
|
4373
|
+
initial: zip$1.initial,
|
|
4374
|
+
intersection,
|
|
4375
|
+
intersectionBy,
|
|
4376
|
+
intersectionWith,
|
|
4377
|
+
invariant: invariant.invariant,
|
|
4378
|
+
invert,
|
|
4379
|
+
invertBy,
|
|
4380
|
+
invoke,
|
|
4381
|
+
isArguments,
|
|
4382
|
+
isArray,
|
|
4383
|
+
isArrayBuffer,
|
|
4384
|
+
isArrayLike,
|
|
4385
|
+
isArrayLikeObject,
|
|
4386
|
+
isBlob: isPromise.isBlob,
|
|
4387
|
+
isBoolean,
|
|
4388
|
+
isBrowser: isPromise.isBrowser,
|
|
4389
|
+
isBuffer,
|
|
4390
|
+
isDate,
|
|
4391
|
+
isElement,
|
|
4392
|
+
isEmpty,
|
|
4393
|
+
isEqual: isPromise.isEqual,
|
|
4394
|
+
isEqualWith,
|
|
4395
|
+
isError,
|
|
4396
|
+
isFile: isPromise.isFile,
|
|
4397
|
+
isFinite,
|
|
4398
|
+
isFunction: isPromise.isFunction,
|
|
4399
|
+
isInteger,
|
|
4400
|
+
isJSON: isPromise.isJSON,
|
|
4401
|
+
isJSONArray: isPromise.isJSONArray,
|
|
4402
|
+
isJSONObject: isPromise.isJSONObject,
|
|
4403
|
+
isJSONValue: isPromise.isJSONValue,
|
|
4404
|
+
isLength: isPromise.isLength,
|
|
4405
|
+
isMap,
|
|
4406
|
+
isMatch,
|
|
4407
|
+
isNaN,
|
|
4408
|
+
isNil,
|
|
4409
|
+
isNode: isPromise.isNode,
|
|
4410
|
+
isNotNil: isPromise.isNotNil,
|
|
4411
|
+
isNull: isPromise.isNull,
|
|
4412
|
+
isNumber,
|
|
4413
|
+
isObject,
|
|
4414
|
+
isObjectLike,
|
|
4415
|
+
isPlainObject,
|
|
4416
|
+
isPrimitive: isPromise.isPrimitive,
|
|
4417
|
+
isPromise: isPromise.isPromise,
|
|
4418
|
+
isRegExp,
|
|
4419
|
+
isSafeInteger,
|
|
4420
|
+
isSet,
|
|
4421
|
+
isString,
|
|
4422
|
+
isSubset: zip$1.isSubset,
|
|
4423
|
+
isSubsetWith: zip$1.isSubsetWith,
|
|
4424
|
+
isSymbol: zip$1.isSymbol,
|
|
4425
|
+
isTypedArray,
|
|
4426
|
+
isUndefined: isPromise.isUndefined,
|
|
4427
|
+
isWeakMap,
|
|
4428
|
+
isWeakSet,
|
|
4429
|
+
iteratee,
|
|
4430
|
+
join,
|
|
4431
|
+
kebabCase,
|
|
4432
|
+
keyBy: zip$1.keyBy,
|
|
4433
|
+
keys,
|
|
4434
|
+
keysIn,
|
|
4435
|
+
last,
|
|
4436
|
+
lastIndexOf,
|
|
4437
|
+
lowerCase,
|
|
4438
|
+
lowerFirst,
|
|
4439
|
+
lt,
|
|
4440
|
+
lte,
|
|
4441
|
+
map,
|
|
4442
|
+
mapKeys,
|
|
4443
|
+
mapValues,
|
|
4444
|
+
matches,
|
|
4445
|
+
matchesProperty,
|
|
4446
|
+
max,
|
|
4447
|
+
maxBy,
|
|
4448
|
+
mean,
|
|
4449
|
+
meanBy,
|
|
4450
|
+
median: range$1.median,
|
|
4451
|
+
medianBy: range$1.medianBy,
|
|
4452
|
+
memoize: unary.memoize,
|
|
4453
|
+
merge,
|
|
4454
|
+
mergeWith,
|
|
4455
|
+
method,
|
|
4456
|
+
methodOf,
|
|
4457
|
+
min,
|
|
4458
|
+
minBy,
|
|
4459
|
+
multiply,
|
|
4460
|
+
negate,
|
|
4461
|
+
noop: noop.noop,
|
|
4462
|
+
now,
|
|
4463
|
+
nth,
|
|
4464
|
+
nthArg,
|
|
4465
|
+
omit,
|
|
4466
|
+
omitBy,
|
|
4467
|
+
once: unary.once,
|
|
4468
|
+
orderBy,
|
|
4469
|
+
over,
|
|
4470
|
+
overEvery,
|
|
4471
|
+
overSome,
|
|
4472
|
+
pad,
|
|
4473
|
+
padEnd,
|
|
4474
|
+
padStart,
|
|
4475
|
+
parseInt,
|
|
4476
|
+
partial,
|
|
4477
|
+
partialRight,
|
|
4478
|
+
partition,
|
|
4479
|
+
pascalCase: reverseString.pascalCase,
|
|
4480
|
+
pick,
|
|
4481
|
+
pickBy,
|
|
4482
|
+
property,
|
|
4483
|
+
propertyOf,
|
|
4484
|
+
pull,
|
|
4485
|
+
pullAll,
|
|
4486
|
+
pullAllBy,
|
|
4487
|
+
pullAllWith,
|
|
4488
|
+
pullAt,
|
|
4489
|
+
random,
|
|
4490
|
+
randomInt: randomInt.randomInt,
|
|
4491
|
+
range,
|
|
4492
|
+
rangeRight,
|
|
4493
|
+
rearg,
|
|
4494
|
+
reduce,
|
|
4495
|
+
reduceRight,
|
|
4496
|
+
reject,
|
|
4497
|
+
remove,
|
|
4498
|
+
repeat,
|
|
4499
|
+
replace,
|
|
4500
|
+
rest,
|
|
4501
|
+
retry: unary.retry,
|
|
4502
|
+
reverse,
|
|
4503
|
+
reverseString: reverseString.reverseString,
|
|
4504
|
+
round,
|
|
4505
|
+
sample,
|
|
4506
|
+
sampleSize: zip$1.sampleSize,
|
|
4507
|
+
set,
|
|
4508
|
+
shuffle: zip$1.shuffle,
|
|
4509
|
+
size,
|
|
4510
|
+
slice,
|
|
4511
|
+
snakeCase,
|
|
4512
|
+
some,
|
|
4513
|
+
sortBy,
|
|
4514
|
+
sortedIndex,
|
|
4515
|
+
sortedIndexBy,
|
|
4516
|
+
sortedIndexOf,
|
|
4517
|
+
sortedLastIndex,
|
|
4518
|
+
sortedLastIndexBy,
|
|
4519
|
+
split,
|
|
4520
|
+
spread,
|
|
4521
|
+
startCase,
|
|
4522
|
+
startsWith,
|
|
4523
|
+
stubArray,
|
|
4524
|
+
stubFalse,
|
|
4525
|
+
stubObject,
|
|
4526
|
+
stubString,
|
|
4527
|
+
stubTrue,
|
|
4528
|
+
subtract,
|
|
4529
|
+
sum,
|
|
4530
|
+
sumBy,
|
|
4531
|
+
tail,
|
|
4532
|
+
take,
|
|
4533
|
+
takeRight,
|
|
4534
|
+
takeRightWhile,
|
|
4535
|
+
takeWhile,
|
|
4536
|
+
template,
|
|
4537
|
+
templateSettings,
|
|
4538
|
+
throttle,
|
|
4539
|
+
timeout: promise_index.timeout,
|
|
4540
|
+
times,
|
|
4541
|
+
toArray,
|
|
4542
|
+
toCamelCaseKeys,
|
|
4543
|
+
toDefaulted,
|
|
4544
|
+
toFilled: zip$1.toFilled,
|
|
4545
|
+
toFinite: zip$1.toFinite,
|
|
4546
|
+
toInteger: zip$1.toInteger,
|
|
4547
|
+
toLength,
|
|
4548
|
+
toLower,
|
|
4549
|
+
toMerged,
|
|
4550
|
+
toNumber: zip$1.toNumber,
|
|
4551
|
+
toPairs,
|
|
4552
|
+
toPairsIn,
|
|
4553
|
+
toPath,
|
|
4554
|
+
toPlainObject,
|
|
4555
|
+
toSafeInteger,
|
|
4556
|
+
toSnakeCaseKeys,
|
|
4557
|
+
toString,
|
|
4558
|
+
toUpper,
|
|
4559
|
+
trim,
|
|
4560
|
+
trimEnd,
|
|
4561
|
+
trimStart,
|
|
4562
|
+
unary: unary.unary,
|
|
4563
|
+
unescape,
|
|
4564
|
+
union,
|
|
4565
|
+
unionBy,
|
|
4566
|
+
unionWith,
|
|
4567
|
+
uniq,
|
|
4568
|
+
uniqBy,
|
|
4569
|
+
uniqWith,
|
|
4570
|
+
uniqueId,
|
|
4571
|
+
unset,
|
|
4572
|
+
unzip,
|
|
4573
|
+
unzipWith: zip$1.unzipWith,
|
|
4574
|
+
update,
|
|
4575
|
+
updateWith,
|
|
4576
|
+
upperCase,
|
|
4577
|
+
upperFirst,
|
|
4578
|
+
values,
|
|
4579
|
+
valuesIn,
|
|
4580
|
+
windowed: zip$1.windowed,
|
|
4581
|
+
withTimeout: promise_index.withTimeout,
|
|
4582
|
+
without,
|
|
4583
|
+
words,
|
|
4584
|
+
xor: zip$1.xor,
|
|
4585
|
+
xorBy: zip$1.xorBy,
|
|
4586
|
+
xorWith: zip$1.xorWith,
|
|
4587
|
+
zip,
|
|
4588
|
+
zipObject,
|
|
4589
|
+
zipObjectDeep,
|
|
4590
|
+
zipWith
|
|
4591
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
4592
|
+
|
|
4593
|
+
const toolkit = ((value) => {
|
|
4594
|
+
return value;
|
|
4595
|
+
});
|
|
4596
|
+
Object.assign(toolkit, compat);
|
|
4597
|
+
toolkit.partial.placeholder = toolkit;
|
|
4598
|
+
toolkit.partialRight.placeholder = toolkit;
|
|
4599
|
+
|
|
4600
|
+
function toCamelCaseKeys(obj) {
|
|
4601
|
+
if (isArray(obj)) {
|
|
4602
|
+
return obj.map(item => toCamelCaseKeys(item));
|
|
4603
|
+
}
|
|
4604
|
+
if (isPlainObject(obj)) {
|
|
4605
|
+
const result = {};
|
|
4606
|
+
const keys = Object.keys(obj);
|
|
4607
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4608
|
+
const key = keys[i];
|
|
4609
|
+
const camelKey = reverseString.camelCase(key);
|
|
4610
|
+
const camelCaseKeys = toCamelCaseKeys(obj[key]);
|
|
4611
|
+
result[camelKey] = camelCaseKeys;
|
|
4612
|
+
}
|
|
4613
|
+
return result;
|
|
4614
|
+
}
|
|
4615
|
+
return obj;
|
|
4616
|
+
}
|
|
4617
|
+
|
|
4618
|
+
function toMerged(target, source) {
|
|
4619
|
+
return merge$1(cloneDeep$1(target), source);
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
function toSnakeCaseKeys(obj) {
|
|
4623
|
+
if (isArray(obj)) {
|
|
4624
|
+
return obj.map(item => toSnakeCaseKeys(item));
|
|
4625
|
+
}
|
|
4626
|
+
if (isPlainObject(obj)) {
|
|
4627
|
+
const result = {};
|
|
4628
|
+
const keys = Object.keys(obj);
|
|
4629
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4630
|
+
const key = keys[i];
|
|
4631
|
+
const snakeKey = reverseString.snakeCase(key);
|
|
4632
|
+
const snakeCaseKeys = toSnakeCaseKeys(obj[key]);
|
|
4633
|
+
result[snakeKey] = snakeCaseKeys;
|
|
4634
|
+
}
|
|
4635
|
+
return result;
|
|
4636
|
+
}
|
|
4637
|
+
return obj;
|
|
4638
|
+
}
|
|
4639
|
+
|
|
4640
|
+
exports.add = add;
|
|
4641
|
+
exports.after = after;
|
|
4642
|
+
exports.ary = ary;
|
|
4643
|
+
exports.assign = assign;
|
|
4644
|
+
exports.assignIn = assignIn;
|
|
4645
|
+
exports.assignInWith = assignInWith;
|
|
4646
|
+
exports.assignWith = assignWith;
|
|
4647
|
+
exports.at = at;
|
|
4648
|
+
exports.attempt = attempt;
|
|
4649
|
+
exports.before = before;
|
|
4650
|
+
exports.bind = bind;
|
|
4651
|
+
exports.bindKey = bindKey;
|
|
4652
|
+
exports.camelCase = camelCase;
|
|
4653
|
+
exports.castArray = castArray;
|
|
4654
|
+
exports.ceil = ceil;
|
|
4655
|
+
exports.chunk = chunk;
|
|
4656
|
+
exports.clamp = clamp;
|
|
4657
|
+
exports.clone = clone;
|
|
4658
|
+
exports.cloneDeep = cloneDeep$1;
|
|
4659
|
+
exports.cloneDeep$1 = cloneDeep;
|
|
4660
|
+
exports.cloneDeepWith = cloneDeepWith$1;
|
|
4661
|
+
exports.cloneDeepWith$1 = cloneDeepWith;
|
|
4662
|
+
exports.compact = compact;
|
|
4663
|
+
exports.concat = concat;
|
|
4664
|
+
exports.cond = cond;
|
|
4665
|
+
exports.conforms = conforms;
|
|
4666
|
+
exports.conformsTo = conformsTo;
|
|
4667
|
+
exports.constant = constant;
|
|
4668
|
+
exports.create = create;
|
|
4669
|
+
exports.curry = curry;
|
|
4670
|
+
exports.curryRight = curryRight;
|
|
4671
|
+
exports.debounce = debounce;
|
|
4672
|
+
exports.deburr = deburr;
|
|
4673
|
+
exports.defaultTo = defaultTo;
|
|
4674
|
+
exports.defaults = defaults;
|
|
4675
|
+
exports.defer = defer;
|
|
4676
|
+
exports.delay = delay;
|
|
4677
|
+
exports.difference = difference;
|
|
4678
|
+
exports.differenceBy = differenceBy;
|
|
4679
|
+
exports.differenceWith = differenceWith;
|
|
4680
|
+
exports.divide = divide;
|
|
4681
|
+
exports.drop = drop;
|
|
4682
|
+
exports.dropRight = dropRight;
|
|
4683
|
+
exports.dropRightWhile = dropRightWhile;
|
|
4684
|
+
exports.dropWhile = dropWhile;
|
|
4685
|
+
exports.endsWith = endsWith;
|
|
4686
|
+
exports.escape = escape;
|
|
4687
|
+
exports.escapeRegExp = escapeRegExp;
|
|
4688
|
+
exports.every = every;
|
|
4689
|
+
exports.fill = fill;
|
|
4690
|
+
exports.filter = filter;
|
|
4691
|
+
exports.find = find;
|
|
4692
|
+
exports.findIndex = findIndex;
|
|
4693
|
+
exports.findKey = findKey$1;
|
|
4694
|
+
exports.findKey$1 = findKey;
|
|
4695
|
+
exports.findLast = findLast;
|
|
4696
|
+
exports.findLastIndex = findLastIndex;
|
|
4697
|
+
exports.flatMap = flatMap;
|
|
4698
|
+
exports.flatten = flatten;
|
|
4699
|
+
exports.flattenDeep = flattenDeep;
|
|
4700
|
+
exports.flattenDepth = flattenDepth;
|
|
4701
|
+
exports.flattenObject = flattenObject;
|
|
4702
|
+
exports.flip = flip;
|
|
4703
|
+
exports.floor = floor;
|
|
4704
|
+
exports.flow = flow;
|
|
4705
|
+
exports.flowRight = flowRight;
|
|
4706
|
+
exports.forEach = forEach;
|
|
4707
|
+
exports.forEachRight = forEachRight;
|
|
4708
|
+
exports.forIn = forIn;
|
|
4709
|
+
exports.forInRight = forInRight;
|
|
4710
|
+
exports.forOwn = forOwn;
|
|
4711
|
+
exports.forOwnRight = forOwnRight;
|
|
4712
|
+
exports.fromPairs = fromPairs;
|
|
4713
|
+
exports.functions = functions;
|
|
4714
|
+
exports.functionsIn = functionsIn;
|
|
4715
|
+
exports.get = get;
|
|
4716
|
+
exports.groupBy = groupBy;
|
|
4717
|
+
exports.gt = gt;
|
|
4718
|
+
exports.gte = gte;
|
|
4719
|
+
exports.has = has;
|
|
4720
|
+
exports.hasIn = hasIn;
|
|
4721
|
+
exports.head = head;
|
|
4722
|
+
exports.inRange = inRange;
|
|
4723
|
+
exports.includes = includes;
|
|
4724
|
+
exports.indexOf = indexOf;
|
|
4725
|
+
exports.intersection = intersection;
|
|
4726
|
+
exports.intersectionBy = intersectionBy;
|
|
4727
|
+
exports.intersectionWith = intersectionWith;
|
|
4728
|
+
exports.invert = invert;
|
|
4729
|
+
exports.invertBy = invertBy;
|
|
4730
|
+
exports.invoke = invoke;
|
|
4731
|
+
exports.isArguments = isArguments;
|
|
4732
|
+
exports.isArray = isArray;
|
|
4733
|
+
exports.isArrayBuffer = isArrayBuffer;
|
|
4734
|
+
exports.isArrayLike = isArrayLike;
|
|
4735
|
+
exports.isArrayLikeObject = isArrayLikeObject;
|
|
4736
|
+
exports.isBoolean = isBoolean;
|
|
4737
|
+
exports.isBuffer = isBuffer;
|
|
4738
|
+
exports.isDate = isDate;
|
|
4739
|
+
exports.isElement = isElement;
|
|
4740
|
+
exports.isEmpty = isEmpty;
|
|
4741
|
+
exports.isEqualWith = isEqualWith;
|
|
4742
|
+
exports.isError = isError;
|
|
4743
|
+
exports.isFinite = isFinite;
|
|
4744
|
+
exports.isInteger = isInteger;
|
|
4745
|
+
exports.isMap = isMap;
|
|
4746
|
+
exports.isMatch = isMatch;
|
|
4747
|
+
exports.isNaN = isNaN;
|
|
4748
|
+
exports.isNil = isNil;
|
|
4749
|
+
exports.isNumber = isNumber;
|
|
4750
|
+
exports.isObject = isObject;
|
|
4751
|
+
exports.isObjectLike = isObjectLike;
|
|
4752
|
+
exports.isPlainObject = isPlainObject;
|
|
4753
|
+
exports.isRegExp = isRegExp;
|
|
4754
|
+
exports.isSafeInteger = isSafeInteger;
|
|
4755
|
+
exports.isSet = isSet;
|
|
4756
|
+
exports.isString = isString;
|
|
4757
|
+
exports.isTypedArray = isTypedArray;
|
|
4758
|
+
exports.isWeakMap = isWeakMap;
|
|
4759
|
+
exports.isWeakSet = isWeakSet;
|
|
4760
|
+
exports.iteratee = iteratee;
|
|
4761
|
+
exports.join = join;
|
|
4762
|
+
exports.kebabCase = kebabCase;
|
|
4763
|
+
exports.keys = keys;
|
|
4764
|
+
exports.keysIn = keysIn;
|
|
4765
|
+
exports.last = last;
|
|
4766
|
+
exports.lastIndexOf = lastIndexOf;
|
|
4767
|
+
exports.lowerCase = lowerCase;
|
|
4768
|
+
exports.lowerFirst = lowerFirst;
|
|
4769
|
+
exports.lt = lt;
|
|
4770
|
+
exports.lte = lte;
|
|
4771
|
+
exports.map = map;
|
|
4772
|
+
exports.mapKeys = mapKeys$1;
|
|
4773
|
+
exports.mapKeys$1 = mapKeys;
|
|
4774
|
+
exports.mapValues = mapValues$1;
|
|
4775
|
+
exports.mapValues$1 = mapValues;
|
|
4776
|
+
exports.matches = matches;
|
|
4777
|
+
exports.matchesProperty = matchesProperty;
|
|
4778
|
+
exports.max = max;
|
|
4779
|
+
exports.maxBy = maxBy;
|
|
4780
|
+
exports.mean = mean;
|
|
4781
|
+
exports.meanBy = meanBy;
|
|
4782
|
+
exports.merge = merge$1;
|
|
4783
|
+
exports.merge$1 = merge;
|
|
4784
|
+
exports.mergeWith = mergeWith;
|
|
4785
|
+
exports.method = method;
|
|
4786
|
+
exports.methodOf = methodOf;
|
|
4787
|
+
exports.min = min;
|
|
4788
|
+
exports.minBy = minBy;
|
|
4789
|
+
exports.multiply = multiply;
|
|
4790
|
+
exports.negate = negate;
|
|
4791
|
+
exports.now = now;
|
|
4792
|
+
exports.nth = nth;
|
|
4793
|
+
exports.nthArg = nthArg;
|
|
4794
|
+
exports.omit = omit;
|
|
4795
|
+
exports.omitBy = omitBy;
|
|
4796
|
+
exports.orderBy = orderBy;
|
|
4797
|
+
exports.over = over;
|
|
4798
|
+
exports.overEvery = overEvery;
|
|
4799
|
+
exports.overSome = overSome;
|
|
4800
|
+
exports.pad = pad;
|
|
4801
|
+
exports.padEnd = padEnd;
|
|
4802
|
+
exports.padStart = padStart;
|
|
4803
|
+
exports.parseInt = parseInt;
|
|
4804
|
+
exports.partial = partial;
|
|
4805
|
+
exports.partialRight = partialRight;
|
|
4806
|
+
exports.partition = partition;
|
|
4807
|
+
exports.pick = pick;
|
|
4808
|
+
exports.pickBy = pickBy;
|
|
4809
|
+
exports.property = property;
|
|
4810
|
+
exports.propertyOf = propertyOf;
|
|
4811
|
+
exports.pull = pull;
|
|
4812
|
+
exports.pullAll = pullAll;
|
|
4813
|
+
exports.pullAllBy = pullAllBy;
|
|
4814
|
+
exports.pullAllWith = pullAllWith;
|
|
4815
|
+
exports.pullAt = pullAt;
|
|
4816
|
+
exports.random = random;
|
|
4817
|
+
exports.range = range;
|
|
4818
|
+
exports.rangeRight = rangeRight;
|
|
4819
|
+
exports.rearg = rearg;
|
|
4820
|
+
exports.reduce = reduce;
|
|
4821
|
+
exports.reduceRight = reduceRight;
|
|
4822
|
+
exports.reject = reject;
|
|
4823
|
+
exports.remove = remove;
|
|
4824
|
+
exports.repeat = repeat;
|
|
4825
|
+
exports.replace = replace;
|
|
4826
|
+
exports.rest = rest;
|
|
4827
|
+
exports.reverse = reverse;
|
|
4828
|
+
exports.round = round;
|
|
4829
|
+
exports.sample = sample;
|
|
4830
|
+
exports.set = set;
|
|
4831
|
+
exports.size = size;
|
|
4832
|
+
exports.slice = slice;
|
|
4833
|
+
exports.snakeCase = snakeCase;
|
|
4834
|
+
exports.some = some;
|
|
4835
|
+
exports.sortBy = sortBy;
|
|
4836
|
+
exports.sortedIndex = sortedIndex;
|
|
4837
|
+
exports.sortedIndexBy = sortedIndexBy;
|
|
4838
|
+
exports.sortedIndexOf = sortedIndexOf;
|
|
4839
|
+
exports.sortedLastIndex = sortedLastIndex;
|
|
4840
|
+
exports.sortedLastIndexBy = sortedLastIndexBy;
|
|
4841
|
+
exports.split = split;
|
|
4842
|
+
exports.spread = spread;
|
|
4843
|
+
exports.startCase = startCase;
|
|
4844
|
+
exports.startsWith = startsWith;
|
|
4845
|
+
exports.stubArray = stubArray;
|
|
4846
|
+
exports.stubFalse = stubFalse;
|
|
4847
|
+
exports.stubObject = stubObject;
|
|
4848
|
+
exports.stubString = stubString;
|
|
4849
|
+
exports.stubTrue = stubTrue;
|
|
4850
|
+
exports.subtract = subtract;
|
|
4851
|
+
exports.sum = sum;
|
|
4852
|
+
exports.sumBy = sumBy;
|
|
4853
|
+
exports.tail = tail;
|
|
4854
|
+
exports.take = take;
|
|
4855
|
+
exports.takeRight = takeRight;
|
|
4856
|
+
exports.takeRightWhile = takeRightWhile;
|
|
4857
|
+
exports.takeWhile = takeWhile;
|
|
4858
|
+
exports.template = template;
|
|
4859
|
+
exports.templateSettings = templateSettings;
|
|
4860
|
+
exports.throttle = throttle;
|
|
4861
|
+
exports.times = times;
|
|
4862
|
+
exports.toArray = toArray;
|
|
4863
|
+
exports.toCamelCaseKeys = toCamelCaseKeys;
|
|
4864
|
+
exports.toDefaulted = toDefaulted;
|
|
4865
|
+
exports.toLength = toLength;
|
|
4866
|
+
exports.toLower = toLower;
|
|
4867
|
+
exports.toMerged = toMerged;
|
|
4868
|
+
exports.toPairs = toPairs;
|
|
4869
|
+
exports.toPairsIn = toPairsIn;
|
|
4870
|
+
exports.toPath = toPath;
|
|
4871
|
+
exports.toPlainObject = toPlainObject;
|
|
4872
|
+
exports.toSafeInteger = toSafeInteger;
|
|
4873
|
+
exports.toSnakeCaseKeys = toSnakeCaseKeys;
|
|
4874
|
+
exports.toString = toString;
|
|
4875
|
+
exports.toUpper = toUpper;
|
|
4876
|
+
exports.toolkit = toolkit;
|
|
4877
|
+
exports.trim = trim;
|
|
4878
|
+
exports.trimEnd = trimEnd;
|
|
4879
|
+
exports.trimStart = trimStart;
|
|
4880
|
+
exports.unescape = unescape;
|
|
4881
|
+
exports.union = union;
|
|
4882
|
+
exports.unionBy = unionBy;
|
|
4883
|
+
exports.unionWith = unionWith;
|
|
4884
|
+
exports.uniq = uniq;
|
|
4885
|
+
exports.uniqBy = uniqBy;
|
|
4886
|
+
exports.uniqWith = uniqWith;
|
|
4887
|
+
exports.uniqueId = uniqueId;
|
|
4888
|
+
exports.unset = unset;
|
|
4889
|
+
exports.unzip = unzip;
|
|
4890
|
+
exports.update = update;
|
|
4891
|
+
exports.updateWith = updateWith;
|
|
4892
|
+
exports.upperCase = upperCase;
|
|
4893
|
+
exports.upperFirst = upperFirst;
|
|
4894
|
+
exports.values = values;
|
|
4895
|
+
exports.valuesIn = valuesIn;
|
|
4896
|
+
exports.without = without;
|
|
4897
|
+
exports.words = words;
|
|
4898
|
+
exports.zip = zip;
|
|
4899
|
+
exports.zipObject = zipObject;
|
|
4900
|
+
exports.zipObjectDeep = zipObjectDeep;
|
|
4901
|
+
exports.zipWith = zipWith;
|