es-toolkit 1.13.1-dev.327 → 1.13.1-dev.329
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +16 -16
- package/dist/array/zipObject.d.mts +1 -1
- package/dist/array/zipObject.d.ts +1 -1
- package/dist/array/zipObject.js.map +1 -1
- package/dist/array/zipObject.mjs +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +18 -18
- package/dist/{chunk-MSHSKENG.mjs → chunk-5F26PFZL.mjs} +1 -1
- package/dist/{chunk-MSHSKENG.mjs.map → chunk-5F26PFZL.mjs.map} +1 -1
- package/dist/{chunk-JYSV56US.mjs → chunk-7GXKT3VW.mjs} +1 -1
- package/dist/chunk-7GXKT3VW.mjs.map +1 -0
- package/dist/{chunk-6GWEY5EL.mjs → chunk-BGWHVWY4.mjs} +1 -1
- package/dist/{chunk-6GWEY5EL.mjs.map → chunk-BGWHVWY4.mjs.map} +1 -1
- package/dist/{chunk-LXO6F6XN.mjs → chunk-GZGXXIF7.mjs} +40 -40
- package/dist/chunk-GZGXXIF7.mjs.map +1 -0
- package/dist/compat/index.d.mts +2 -2
- package/dist/compat/index.d.ts +2 -2
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +39 -39
- package/dist/function/debounce.js.map +1 -1
- package/dist/function/debounce.mjs +1 -1
- package/dist/function/index.js.map +1 -1
- package/dist/function/index.mjs +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -40
- package/dist/predicate/index.js.map +1 -1
- package/dist/predicate/index.mjs +1 -1
- package/dist/predicate/isEqual.js.map +1 -1
- package/dist/predicate/isEqual.mjs +1 -1
- package/package.json +4 -1
- package/umd/browser.global.js +1 -1
- package/dist/chunk-JYSV56US.mjs.map +0 -1
- package/dist/chunk-LXO6F6XN.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
} from "./chunk-27QMXBLJ.mjs";
|
|
58
58
|
import {
|
|
59
59
|
isEqual
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7GXKT3VW.mjs";
|
|
61
61
|
import "./chunk-YXAOYIRV.mjs";
|
|
62
62
|
import {
|
|
63
63
|
invert
|
|
@@ -111,29 +111,7 @@ import {
|
|
|
111
111
|
import {
|
|
112
112
|
sum
|
|
113
113
|
} from "./chunk-2SLTL4KL.mjs";
|
|
114
|
-
import "./chunk-ZA2XI3OV.mjs";
|
|
115
|
-
import {
|
|
116
|
-
throttle
|
|
117
|
-
} from "./chunk-QOJGMVVR.mjs";
|
|
118
|
-
import {
|
|
119
|
-
after
|
|
120
|
-
} from "./chunk-OGZMEWPR.mjs";
|
|
121
|
-
import {
|
|
122
|
-
debounce
|
|
123
|
-
} from "./chunk-MSHSKENG.mjs";
|
|
124
|
-
import {
|
|
125
|
-
negate
|
|
126
|
-
} from "./chunk-BOOQBJN2.mjs";
|
|
127
|
-
import {
|
|
128
|
-
noop
|
|
129
|
-
} from "./chunk-LKXCOLNY.mjs";
|
|
130
|
-
import {
|
|
131
|
-
once
|
|
132
|
-
} from "./chunk-CMBC4MXG.mjs";
|
|
133
114
|
import "./chunk-DDH7K4QM.mjs";
|
|
134
|
-
import {
|
|
135
|
-
zipObject
|
|
136
|
-
} from "./chunk-6GWEY5EL.mjs";
|
|
137
115
|
import {
|
|
138
116
|
zipWith
|
|
139
117
|
} from "./chunk-MJ7LNBI6.mjs";
|
|
@@ -159,8 +137,8 @@ import {
|
|
|
159
137
|
zip
|
|
160
138
|
} from "./chunk-OLORW442.mjs";
|
|
161
139
|
import {
|
|
162
|
-
|
|
163
|
-
} from "./chunk-
|
|
140
|
+
zipObject
|
|
141
|
+
} from "./chunk-BGWHVWY4.mjs";
|
|
164
142
|
import {
|
|
165
143
|
takeWhile
|
|
166
144
|
} from "./chunk-2IXFGSUA.mjs";
|
|
@@ -176,9 +154,6 @@ import {
|
|
|
176
154
|
import {
|
|
177
155
|
unionWith
|
|
178
156
|
} from "./chunk-2ZCITDMK.mjs";
|
|
179
|
-
import {
|
|
180
|
-
uniqWith
|
|
181
|
-
} from "./chunk-237HGSZS.mjs";
|
|
182
157
|
import {
|
|
183
158
|
uniq
|
|
184
159
|
} from "./chunk-DVK2N4KC.mjs";
|
|
@@ -186,8 +161,8 @@ import {
|
|
|
186
161
|
uniqBy
|
|
187
162
|
} from "./chunk-B4COTK4K.mjs";
|
|
188
163
|
import {
|
|
189
|
-
|
|
190
|
-
} from "./chunk-
|
|
164
|
+
uniqWith
|
|
165
|
+
} from "./chunk-237HGSZS.mjs";
|
|
191
166
|
import {
|
|
192
167
|
partition
|
|
193
168
|
} from "./chunk-DN3NOZ3H.mjs";
|
|
@@ -216,8 +191,8 @@ import {
|
|
|
216
191
|
takeRight
|
|
217
192
|
} from "./chunk-N3QYJX4T.mjs";
|
|
218
193
|
import {
|
|
219
|
-
|
|
220
|
-
} from "./chunk-
|
|
194
|
+
takeRightWhile
|
|
195
|
+
} from "./chunk-NTLX2MPV.mjs";
|
|
221
196
|
import {
|
|
222
197
|
intersection
|
|
223
198
|
} from "./chunk-FVVSE2F2.mjs";
|
|
@@ -240,8 +215,8 @@ import {
|
|
|
240
215
|
minBy
|
|
241
216
|
} from "./chunk-IJD7FE2Z.mjs";
|
|
242
217
|
import {
|
|
243
|
-
|
|
244
|
-
} from "./chunk-
|
|
218
|
+
orderBy
|
|
219
|
+
} from "./chunk-7B7W36UP.mjs";
|
|
245
220
|
import {
|
|
246
221
|
flatMap
|
|
247
222
|
} from "./chunk-UY76KTPE.mjs";
|
|
@@ -261,8 +236,8 @@ import {
|
|
|
261
236
|
head
|
|
262
237
|
} from "./chunk-FZZNWXDM.mjs";
|
|
263
238
|
import {
|
|
264
|
-
|
|
265
|
-
} from "./chunk-
|
|
239
|
+
initial
|
|
240
|
+
} from "./chunk-XPSOKBRZ.mjs";
|
|
266
241
|
import {
|
|
267
242
|
difference
|
|
268
243
|
} from "./chunk-JPUKH67K.mjs";
|
|
@@ -284,6 +259,31 @@ import {
|
|
|
284
259
|
import {
|
|
285
260
|
dropWhile
|
|
286
261
|
} from "./chunk-LJ2C6MVP.mjs";
|
|
262
|
+
import {
|
|
263
|
+
fill
|
|
264
|
+
} from "./chunk-GTFDDKZ2.mjs";
|
|
265
|
+
import "./chunk-ZA2XI3OV.mjs";
|
|
266
|
+
import {
|
|
267
|
+
negate
|
|
268
|
+
} from "./chunk-BOOQBJN2.mjs";
|
|
269
|
+
import {
|
|
270
|
+
noop
|
|
271
|
+
} from "./chunk-LKXCOLNY.mjs";
|
|
272
|
+
import {
|
|
273
|
+
once
|
|
274
|
+
} from "./chunk-CMBC4MXG.mjs";
|
|
275
|
+
import {
|
|
276
|
+
throttle
|
|
277
|
+
} from "./chunk-QOJGMVVR.mjs";
|
|
278
|
+
import {
|
|
279
|
+
chunk
|
|
280
|
+
} from "./chunk-E6C5EZQA.mjs";
|
|
281
|
+
import {
|
|
282
|
+
compact
|
|
283
|
+
} from "./chunk-PJPGJ2O6.mjs";
|
|
284
|
+
import {
|
|
285
|
+
countBy
|
|
286
|
+
} from "./chunk-Z7HWEOQX.mjs";
|
|
287
287
|
import "./chunk-F47GLYUU.mjs";
|
|
288
288
|
import {
|
|
289
289
|
AbortError
|
|
@@ -292,11 +292,11 @@ import {
|
|
|
292
292
|
TimeoutError
|
|
293
293
|
} from "./chunk-KIOYQRMQ.mjs";
|
|
294
294
|
import {
|
|
295
|
-
|
|
296
|
-
} from "./chunk-
|
|
295
|
+
after
|
|
296
|
+
} from "./chunk-OGZMEWPR.mjs";
|
|
297
297
|
import {
|
|
298
|
-
|
|
299
|
-
} from "./chunk-
|
|
298
|
+
debounce
|
|
299
|
+
} from "./chunk-5F26PFZL.mjs";
|
|
300
300
|
import "./chunk-J5LGTIGS.mjs";
|
|
301
301
|
export {
|
|
302
302
|
AbortError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/index.ts","../../src/array/uniq.ts","../../src/array/union.ts","../../src/predicate/isEqual.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts","../../src/predicate/isLength.ts","../../src/predicate/isPlainObject.ts","../../src/predicate/isFunction.ts","../../src/predicate/isArrayLike.ts","../../src/predicate/isTypedArray.ts","../../src/predicate/isPrimitive.ts"],"sourcesContent":["export { isEqual } from './isEqual.ts';\nexport { isNil } from './isNil.ts';\nexport { isNotNil } from './isNotNil.ts';\nexport { isNull } from './isNull.ts';\nexport { isUndefined } from './isUndefined.ts';\nexport { isLength } from './isLength.ts';\nexport { isPlainObject } from './isPlainObject.ts';\nexport { isFunction } from './isFunction.ts';\nexport { isArrayLike } from './isArrayLike.ts';\nexport { isTypedArray } from './isTypedArray.ts';\nexport { isPrimitive } from './isPrimitive.ts';\n","/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n","import { uniq } from './uniq.ts';\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n","import { union } from \"../array/union.ts\";\n\n/**\n * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n *\n * @param {unknown} a - The first value to compare.\n * @param {unknown} b - The second value to compare.\n * @returns {boolean} `true` if the values are equal, otherwise `false`.\n *\n * @example\n * isEqual(1, 1); // true\n * isEqual({ a: 1 }, { a: 1 }); // true\n * isEqual(/abc/g, /abc/g); // true\n * isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n\n const aKeys = Object.keys(a as object);\n const bKeys = Object.keys(b as object);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n // check if all keys in both arrays match\n if (union(aKeys, bKeys).length !== aKeys.length) {\n return false;\n }\n\n for (let i = 0; i < aKeys.length; i++) {\n const propKey = aKeys[i];\n const aProp = (a as any)[propKey];\n const bProp = (b as any)[propKey];\n \n if (!isEqual(aProp, bProp)) {\n return false;\n }\n }\n\n return true;\n}\n","/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null;\n}\n","/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @template T - The type of value.\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n","/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n","/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n","export function isLength(value: unknown): value is number {\n return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= Number.MAX_SAFE_INTEGER;\n}\n","/**\n * Checks if a given value is a plain object.\n * \n * @param {object} object - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n * \n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(Buffer.from('hello, world')); // false\n */\nexport function isPlainObject(object: object): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n return false;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}","/**\n * Checks if `value` is a function.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n *\n * @example\n * isFunction(Array.prototype.slice); // true\n * isFunction(async function () {}); // true\n * isFunction(function* () {}); // true\n * isFunction(Proxy); // true\n * isFunction(Int8Array); // true\n */\nexport function isFunction(value: unknown): value is (...args: unknown[]) => unknown {\n return typeof value === 'function';\n}\n","import { isLength } from \"./isLength.ts\";\n\n/**\n * Checks if `value` is array-like.\n *\n * @param {unknown} value The value to check.\n * @returns {value is ArrayLike<unknown>} Returns `true` if `value` is array-like, else `false`.\n *\n * @example\n * isArrayLike([1, 2, 3]); // true\n * isArrayLike('abc'); // true\n * isArrayLike({ 0: 'a', length: 1 }); // true\n * isArrayLike({}); // false\n * isArrayLike(null); // false\n * isArrayLike(undefined); // false\n */\nexport function isArrayLike(value: unknown): value is ArrayLike<unknown> {\n return value != null && typeof value !== \"function\" &&\n isLength((value as ArrayLike<unknown>).length);\n}\n","/**\n * Checks if a value is a TypedArray.\n * @param {unknown} x The value to check.\n * @returns {x is\n * | Uint8Array\n * | Uint8ClampedArray\n * | Uint16Array\n * | Uint32Array\n * | BigUint64Array\n * | Int8Array\n * | Int16Array\n * | Int32Array\n * | BigInt64Array\n * | Float32Array\n * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.\n */\nexport function isTypedArray(\n x: unknown\n): x is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n x instanceof Uint8Array ||\n x instanceof Uint8ClampedArray ||\n x instanceof Uint16Array ||\n x instanceof Uint32Array ||\n x instanceof BigUint64Array ||\n x instanceof Int8Array ||\n x instanceof Int16Array ||\n x instanceof Int32Array ||\n x instanceof BigInt64Array ||\n x instanceof Float32Array ||\n x instanceof Float64Array\n );\n}\n","/**\n * Checks whether a value is a JavaScript primitive.\n * JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.\n *\n * @param {unknown} x The value to check.\n * @returns {x is\n * | null\n * | undefined\n * | string\n * | number\n * | boolean\n * | symbol\n * | bigint} Returns true if `x` is a primitive, false otherwise.\n */\nexport function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;;;ACEO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;;;ACLO,SAAS,QAAQ,GAAY,GAAqB;AACvD,MAAI,OAAO,GAAG,GAAG,CAAC,GAAG;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,QAAQ,aAAa,MAAM;AAC1C,WAAO,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAAA,EACnC;AAEA,MAAI,aAAa,UAAU,aAAa,QAAQ;AAC9C,WAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE;AAAA,EAChD;AAEA,MAAI,OAAO,MAAM,YAAY,OAAO,MAAM,YAAY,MAAM,QAAQ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xBO,SAAS,WAAW,OAA0D;AACnF,SAAO,OAAO,UAAU;AAC1B;;;ACCO,SAAS,YAAY,OAA6C;AACvE,SAAO,SAAS,QAAQ,OAAO,UAAU,cACvC,SAAU,MAA6B,MAAM;AACjD;;;ACHO,SAAS,aACd,GAYe;AACf,SACE,aAAa,cACb,aAAa,qBACb,aAAa,eACb,aAAa,eACb,aAAa,kBACb,aAAa,aACb,aAAa,cACb,aAAa,cACb,aAAa,iBACb,aAAa,gBACb,aAAa;AAEjB;;;AC7BO,SAAS,YAAY,OAAyF;AACnH,SAAO,SAAS,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU;AACzE;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/index.ts","../../src/array/uniq.ts","../../src/array/union.ts","../../src/predicate/isEqual.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts","../../src/predicate/isLength.ts","../../src/predicate/isPlainObject.ts","../../src/predicate/isFunction.ts","../../src/predicate/isArrayLike.ts","../../src/predicate/isTypedArray.ts","../../src/predicate/isPrimitive.ts"],"sourcesContent":["export { isEqual } from './isEqual.ts';\nexport { isNil } from './isNil.ts';\nexport { isNotNil } from './isNotNil.ts';\nexport { isNull } from './isNull.ts';\nexport { isUndefined } from './isUndefined.ts';\nexport { isLength } from './isLength.ts';\nexport { isPlainObject } from './isPlainObject.ts';\nexport { isFunction } from './isFunction.ts';\nexport { isArrayLike } from './isArrayLike.ts';\nexport { isTypedArray } from './isTypedArray.ts';\nexport { isPrimitive } from './isPrimitive.ts';\n","/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n","import { uniq } from './uniq.ts';\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n","import { union } from \"../array/union.ts\";\n\n/**\n * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n *\n * @param {unknown} a - The first value to compare.\n * @param {unknown} b - The second value to compare.\n * @returns {boolean} `true` if the values are equal, otherwise `false`.\n *\n * @example\n * isEqual(1, 1); // true\n * isEqual({ a: 1 }, { a: 1 }); // true\n * isEqual(/abc/g, /abc/g); // true\n * isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n // check if all keys in both arrays match\n if (union(aKeys, bKeys).length !== aKeys.length) {\n return false;\n }\n\n for (let i = 0; i < aKeys.length; i++) {\n const propKey = aKeys[i];\n const aProp = (a as any)[propKey];\n const bProp = (b as any)[propKey];\n \n if (!isEqual(aProp, bProp)) {\n return false;\n }\n }\n\n return true;\n}\n","/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null;\n}\n","/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @template T - The type of value.\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n","/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n","/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n","export function isLength(value: unknown): value is number {\n return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= Number.MAX_SAFE_INTEGER;\n}\n","/**\n * Checks if a given value is a plain object.\n * \n * @param {object} object - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n * \n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(Buffer.from('hello, world')); // false\n */\nexport function isPlainObject(object: object): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n return false;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}","/**\n * Checks if `value` is a function.\n *\n * @param {unknown} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n *\n * @example\n * isFunction(Array.prototype.slice); // true\n * isFunction(async function () {}); // true\n * isFunction(function* () {}); // true\n * isFunction(Proxy); // true\n * isFunction(Int8Array); // true\n */\nexport function isFunction(value: unknown): value is (...args: unknown[]) => unknown {\n return typeof value === 'function';\n}\n","import { isLength } from \"./isLength.ts\";\n\n/**\n * Checks if `value` is array-like.\n *\n * @param {unknown} value The value to check.\n * @returns {value is ArrayLike<unknown>} Returns `true` if `value` is array-like, else `false`.\n *\n * @example\n * isArrayLike([1, 2, 3]); // true\n * isArrayLike('abc'); // true\n * isArrayLike({ 0: 'a', length: 1 }); // true\n * isArrayLike({}); // false\n * isArrayLike(null); // false\n * isArrayLike(undefined); // false\n */\nexport function isArrayLike(value: unknown): value is ArrayLike<unknown> {\n return value != null && typeof value !== \"function\" &&\n isLength((value as ArrayLike<unknown>).length);\n}\n","/**\n * Checks if a value is a TypedArray.\n * @param {unknown} x The value to check.\n * @returns {x is\n * | Uint8Array\n * | Uint8ClampedArray\n * | Uint16Array\n * | Uint32Array\n * | BigUint64Array\n * | Int8Array\n * | Int16Array\n * | Int32Array\n * | BigInt64Array\n * | Float32Array\n * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.\n */\nexport function isTypedArray(\n x: unknown\n): x is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return (\n x instanceof Uint8Array ||\n x instanceof Uint8ClampedArray ||\n x instanceof Uint16Array ||\n x instanceof Uint32Array ||\n x instanceof BigUint64Array ||\n x instanceof Int8Array ||\n x instanceof Int16Array ||\n x instanceof Int32Array ||\n x instanceof BigInt64Array ||\n x instanceof Float32Array ||\n x instanceof Float64Array\n );\n}\n","/**\n * Checks whether a value is a JavaScript primitive.\n * JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.\n *\n * @param {unknown} x The value to check.\n * @returns {x is\n * | null\n * | undefined\n * | string\n * | number\n * | boolean\n * | symbol\n * | bigint} Returns true if `x` is a primitive, false otherwise.\n */\nexport function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;;;ACEO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,KAAK,SAAS,OAAO;AACvF;;;ACWO,SAAS,cAAc,QAAyB;AACrD,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,MAAM,MAAM,MAAM;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,SAAS,MAAM,mBAAmB;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ;AAEZ,SAAO,OAAO,eAAe,KAAK,MAAM,MAAM;AAC5C,YAAQ,OAAO,eAAe,KAAK;AAAA,EACrC;AAEA,SAAO,OAAO,eAAe,MAAM,MAAM;AAC3C;;;ACxBO,SAAS,WAAW,OAA0D;AACnF,SAAO,OAAO,UAAU;AAC1B;;;ACCO,SAAS,YAAY,OAA6C;AACvE,SAAO,SAAS,QAAQ,OAAO,UAAU,cACvC,SAAU,MAA6B,MAAM;AACjD;;;ACHO,SAAS,aACd,GAYe;AACf,SACE,aAAa,cACb,aAAa,qBACb,aAAa,eACb,aAAa,eACb,aAAa,kBACb,aAAa,aACb,aAAa,cACb,aAAa,cACb,aAAa,iBACb,aAAa,gBACb,aAAa;AAEjB;;;AC7BO,SAAS,YAAY,OAAyF;AACnH,SAAO,SAAS,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU;AACzE;","names":[]}
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/isEqual.ts","../../src/array/uniq.ts","../../src/array/union.ts"],"sourcesContent":["import { union } from \"../array/union.ts\";\n\n/**\n * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n *\n * @param {unknown} a - The first value to compare.\n * @param {unknown} b - The second value to compare.\n * @returns {boolean} `true` if the values are equal, otherwise `false`.\n *\n * @example\n * isEqual(1, 1); // true\n * isEqual({ a: 1 }, { a: 1 }); // true\n * isEqual(/abc/g, /abc/g); // true\n * isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n\n const aKeys = Object.keys(a
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/isEqual.ts","../../src/array/uniq.ts","../../src/array/union.ts"],"sourcesContent":["import { union } from \"../array/union.ts\";\n\n/**\n * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n *\n * @param {unknown} a - The first value to compare.\n * @param {unknown} b - The second value to compare.\n * @returns {boolean} `true` if the values are equal, otherwise `false`.\n *\n * @example\n * isEqual(1, 1); // true\n * isEqual({ a: 1 }, { a: 1 }); // true\n * isEqual(/abc/g, /abc/g); // true\n * isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n // check if all keys in both arrays match\n if (union(aKeys, bKeys).length !== aKeys.length) {\n return false;\n }\n\n for (let i = 0; i < aKeys.length; i++) {\n const propKey = aKeys[i];\n const aProp = (a as any)[propKey];\n const bProp = (b as any)[propKey];\n \n if (!isEqual(aProp, bProp)) {\n return false;\n }\n }\n\n return true;\n}\n","/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n return Array.from(new Set(arr));\n}\n","import { uniq } from './uniq.ts';\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAAQ,KAAwB;AAC9C,SAAO,MAAM,KAAK,IAAI,IAAI,GAAG,CAAC;AAChC;;;ACEO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;;;AFLO,SAAS,QAAQ,GAAY,GAAqB;AACvD,MAAI,OAAO,GAAG,GAAG,CAAC,GAAG;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,QAAQ,aAAa,MAAM;AAC1C,WAAO,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAAA,EACnC;AAEA,MAAI,aAAa,UAAU,aAAa,QAAQ;AAC9C,WAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE;AAAA,EAChD;AAEA,MAAI,OAAO,MAAM,YAAY,OAAO,MAAM,YAAY,MAAM,QAAQ,MAAM,MAAM;AAC9E,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM,QAAQ;AACjC,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,OAAO,KAAK,EAAE,WAAW,MAAM,QAAQ;AAC/C,WAAO;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,UAAU,MAAM,CAAC;AACvB,UAAM,QAAS,EAAU,OAAO;AAChC,UAAM,QAAS,EAAU,OAAO;AAEhC,QAAI,CAAC,QAAQ,OAAO,KAAK,GAAG;AAC1B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.13.1-dev.
|
|
4
|
+
"version": "1.13.1-dev.329+5e877faf",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|
|
@@ -222,6 +222,7 @@
|
|
|
222
222
|
"@types/babel__preset-env": "^7",
|
|
223
223
|
"@types/broken-link-checker": "^0",
|
|
224
224
|
"@types/node": "^20.12.11",
|
|
225
|
+
"@types/tar": "^6.1.13",
|
|
225
226
|
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
226
227
|
"@typescript-eslint/parser": "^7.7.1",
|
|
227
228
|
"@vitest/coverage-istanbul": "^1.5.2",
|
|
@@ -229,7 +230,9 @@
|
|
|
229
230
|
"eslint": "^8.56.0",
|
|
230
231
|
"eslint-config-prettier": "^8.5.0",
|
|
231
232
|
"eslint-plugin-jsdoc": "^48.5.0",
|
|
233
|
+
"execa": "^9.3.0",
|
|
232
234
|
"prettier": "^3.2.5",
|
|
235
|
+
"tar": "^6",
|
|
233
236
|
"tsup": "^8.1.0",
|
|
234
237
|
"typescript": "^5.4.5",
|
|
235
238
|
"vitest": "^1.5.2"
|
package/umd/browser.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(()=>{var Kt=Object.defineProperty;var At=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})};var N={};At(N,{AbortError:()=>T,TimeoutError:()=>m,after:()=>we,camelCase:()=>tt,capitalize:()=>D,chunk:()=>at,clamp:()=>Oe,clone:()=>ze,cloneDeep:()=>c,compact:()=>L,concat:()=>ut,countBy:()=>_,debounce:()=>Ue,delay:()=>F,difference:()=>st,differenceBy:()=>g,differenceWith:()=>h,drop:()=>q,dropRight:()=>j,dropRightWhile:()=>$,dropWhile:()=>G,endsWith:()=>gt,fill:()=>ft,first:()=>S,flatMap:()=>Y,flatten:()=>f,flattenDeep:()=>H,flattenObject:()=>_e,forEachRight:()=>Z,get:()=>Tt,groupBy:()=>J,head:()=>S,inRange:()=>Ee,initial:()=>ke,intersection:()=>b,intersectionBy:()=>K,intersectionWith:()=>A,invert:()=>Ce,isArray:()=>yt,isArrayLike:()=>He,isEqual:()=>V,isFunction:()=>Ye,isLength:()=>E,isNil:()=>je,isNotNil:()=>$e,isNull:()=>Ge,isPlainObject:()=>mt,isPrimitive:()=>Je,isTypedArray:()=>dt,isUndefined:()=>Xe,kebabCase:()=>rt,keyBy:()=>Q,last:()=>Ae,lowerCase:()=>ot,max:()=>ht,maxBy:()=>ee,mean:()=>O,meanBy:()=>Fe,min:()=>bt,minBy:()=>te,negate:()=>Ie,noop:()=>Re,omit:()=>We,omitBy:()=>Se,once:()=>ve,orderBy:()=>ne,partition:()=>re,pick:()=>Ve,pickBy:()=>Ne,random:()=>k,randomInt:()=>w,range:()=>Be,round:()=>De,sample:()=>oe,sampleSize:()=>ie,set:()=>B,shuffle:()=>ae,snakeCase:()=>nt,startCase:()=>it,startsWith:()=>xt,sum:()=>y,sumBy:()=>Me,tail:()=>be,take:()=>ue,takeRight:()=>se,takeRightWhile:()=>fe,takeWhile:()=>le,throttle:()=>Pe,toFilled:()=>Ke,union:()=>p,unionBy:()=>R,unionWith:()=>P,uniq:()=>U,uniqBy:()=>ce,uniqWith:()=>v,unzip:()=>pe,unzipWith:()=>Te,withTimeout:()=>et,without:()=>he,xor:()=>me,xorBy:()=>ye,xorWith:()=>de,zip:()=>I,zipObject:()=>xe,zipObjectDeep:()=>ct,zipWith:()=>ge});function z(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");let n=Math.ceil(e.length/t),r=Array(n);for(let o=0;o<n;o++){let i=o*t,a=i+t;r[o]=e.slice(i,a)}return r}function L(e){let t=[];for(let n of e)n&&t.push(n);return t}function _(e,t){let n={};for(let r of e){let o=t(r);n[o]=(n[o]??0)+1}return n}function x(e,t){let n=new Set(t);return e.filter(r=>!n.has(r))}function g(e,t,n){let r=new Set(t.map(o=>n(o)));return e.filter(o=>!r.has(n(o)))}function h(e,t,n){return e.filter(r=>t.every(o=>!n(r,o)))}function q(e,t){return t=Math.max(t,0),e.slice(t)}function j(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function $(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(0,n+1);return[]}function G(e,t){let n=e.findIndex(r=>!t(r));return n===-1?[]:e.slice(n)}function X(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),a=Math.min(r>=0?r:o+r,o);for(let u=i;u<a;u++)e[u]=t;return e}function f(e,t=1){let n=[],r=Math.floor(t),o=(i,a)=>{for(let u of i)Array.isArray(u)&&a<r?o(u,a+1):n.push(u)};return o(e,0),n}function Y(e,t,n=1){return f(e.map(r=>t(r)),n)}function H(e){return f(e,1/0)}function Z(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];t(r,n,e)}}function J(e,t){let n={};for(let r of e){let o=t(r);n[o]==null&&(n[o]=[]),n[o].push(r)}return n}function b(e,t){let n=new Set(t);return e.filter(r=>n.has(r))}function K(e,t,n){let r=new Set(t.map(n));return e.filter(o=>r.has(n(o)))}function A(e,t,n){return e.filter(r=>t.some(o=>n(r,o)))}function Q(e,t){let n={};for(let r of e){let o=t(r);n[o]=r}return n}function ee(e,t){let n=e[0],r=-1/0;for(let o of e){let i=t(o);i>r&&(r=i,n=o)}return n}function te(e,t){let n=e[0],r=1/0;for(let o of e){let i=t(o);i<r&&(r=i,n=o)}return n}function ne(e,t,n){let r=(i,a,u)=>i<a?u==="asc"?-1:1:i>a?u==="asc"?1:-1:0,o=t.map((i,a)=>n[a]||n[n.length-1]);return e.slice().sort((i,a)=>{for(let u=0;u<t.length;u++){let s=t[u],W=o[u],C=r(i[s],a[s],W);if(C!==0)return C}return 0})}function re(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return[n,r]}function oe(e){let t=Math.floor(Math.random()*e.length);return e[t]}function k(e,t){if(t==null&&(t=e,e=0),e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function w(e,t){return Math.floor(k(e,t))}function ie(e,t){if(t>e.length)throw new Error("Size must be less than or equal to the length of array.");let n=new Array(t),r=new Set;for(let o=e.length-t,i=0;o<e.length;o++,i++){let a=w(0,o+1);r.has(a)&&(a=o),r.add(a),n[i]=e[a]}return n}function ae(e){let t=e.slice();for(let n=t.length-1;n>=1;n--){let r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function ue(e,t){return e.slice(0,t)}function se(e,t=1){return t<=0?[]:e.slice(-t)}function fe(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(n+1);return e.slice()}function le(e,t){let n=[];for(let r of e){if(!t(r))break;n.push(r)}return n}function U(e){return Array.from(new Set(e))}function p(e,t){return U(e.concat(t))}function R(e,t,n){let r=new Map;for(let o of[...e,...t]){let i=n(o);r.has(i)||r.set(i,o)}return Array.from(r.values())}function v(e,t){let n=[];for(let r of e)n.every(i=>!t(i,r))&&n.push(r);return n}function P(e,t,n){return v(e.concat(t),n)}function ce(e,t){let n=new Map;for(let r of e){let o=t(r);n.has(o)||n.set(o,r)}return Array.from(n.values())}function pe(e){let t=0;for(let r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length);let n=new Array(t);for(let r=0;r<t;r++){n[r]=new Array(e.length);for(let o=0;o<e.length;o++)n[r][o]=e[o][r]}return n}function Te(e,t){let n=Math.max(...e.map(o=>o.length)),r=new Array(n);for(let o=0;o<n;o++){let i=new Array(e.length);for(let a=0;a<e.length;a++)i[a]=e[a][o];r[o]=t(...i)}return r}function me(e,t){return x(p(e,t),b(e,t))}function ye(e,t,n){let r=R(e,t,n),o=K(e,t,n);return g(r,o,n)}function de(e,t,n){let r=P(e,t,n),o=A(e,t,n);return h(r,o,n)}function I(...e){let t=[],n=Math.max(...e.map(r=>r.length));for(let r=0;r<n;r++){let o=[];for(let i of e)o.push(i[r]);t.push(o)}return t}function xe(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=t[r];return n}function ge(e,...t){let n=[e,...t.slice(0,-1)],r=t[t.length-1],o=[],i=Math.max(...n.map(a=>a.length));for(let a=0;a<i;a++){let u=n.map(s=>s[a]);o.push(r(...u))}return o}function he(e,...t){let n=new Set(t);return e.filter(r=>!n.has(r))}function S(e){return e[0]}function be(e){let t=e.length;if(t<=1)return[];let n=new Array(t-1);for(let r=1;r<t;r++)n[r-1]=e[r];return n}function Ke(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),a=Math.min(r>=0?r:o+r,o),u=e.slice();for(let s=i;s<a;s++)u[s]=t;return u}function Ae(e){return e[e.length-1]}function ke(e){return e.length<=1?[]:e.slice(0,-1)}var T=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var m=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};var we=(e,t)=>{if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n>=e)return t(...r)}};function Ue(e,t,{signal:n}={}){let r=null,o=function(...a){r!==null&&clearTimeout(r),!n?.aborted&&(r=setTimeout(()=>{e(...a),r=null},t))},i=function(){o.cancel()};return o.cancel=function(){r!==null&&(clearTimeout(r),r=null)},n?.addEventListener("abort",i,{once:!0}),o}function Re(){}function ve(e){let t=!1,n;return function(){if(t)return n;let r=e();return t=!0,n=r,r}}function Pe(e,t){let n;return function(...o){let i=Date.now();(n==null||i-n>=t)&&(n=i,e(...o))}}function Ie(e){return(...t)=>!e(...t)}function Oe(e,t,n){return n==null?Math.min(e,t):Math.min(Math.max(e,t),n)}function Ee(e,t,n){if(n==null&&(n=t,t=0),t>=n)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&e<n}function y(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function O(e){return y(e)/e.length}function Fe(e,t){let n=e.map(r=>t(r));return O(n)}function De(e,t=0){if(!Number.isInteger(t))throw new Error("Precision must be an integer.");let n=Math.pow(10,t);return Math.round(e*n)/n}function Me(e,t){let n=e.map(r=>t(r));return y(n)}function Be(e,t,n){if(t==null&&(t=e,e=0),n==null&&(n=1),!Number.isInteger(n)||n===0)throw new Error("The step value must be a non-zero integer.");let r=Math.max(Math.ceil((t-e)/n),0),o=new Array(r);for(let i=0;i<r;i++)o[i]=e+i*n;return o}function We(e,t){let n={...e};for(let r of t)delete n[r];return n}function Se(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)||(n[r]=o);return n}function Ve(e,t){let n={};for(let r of t)n[r]=e[r];return n}function Ne(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)&&(n[r]=o);return n}function Ce(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let o=n[r],i=e[o];t[i]=o}return t}function ze(e){if(kt(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[n,r]of e)t.set(n,r);return t}if(e instanceof Set){let t=new Set;for(let n of e)t.add(n);return t}if(typeof e=="object"){let t=Object.getPrototypeOf(e),n=Object.create(t);return Object.assign(n,e)}return e}function kt(e){return e==null||typeof e!="object"&&typeof e!="function"}function c(e){if(wt(e))return e;if(Array.isArray(e))return e.map(t=>c(t));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[n,r]of e.entries())t.set(n,c(r));return t}if(e instanceof Set){let t=new Set;for(let n of e.values())t.add(c(n));return t}if(Ut(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);for(let n=0;n<e.length;n++)t[n]=c(e[n]);return t}if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0));return d(e,t),t}if(typeof File<"u"&&e instanceof File){let t=new File([e],e.name,{type:e.type});return d(e,t),t}if(e instanceof Blob){let t=new Blob([e],{type:e.type});return d(e,t),t}if(e instanceof Error){let t=new e.constructor;return t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,d(e,t),t}if(typeof e=="object"&&e!==null){let t={};return d(e,t),t}if(typeof e!="function")return e}function wt(e){return e==null||typeof e!="object"&&typeof e!="function"}function d(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=Object.getOwnPropertyDescriptor(e,n);(r?.writable||r?.set)&&typeof r?.value!="function"&&(t[n]=c(e[n]))}}function Ut(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function Le(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _e(e){return qe(e)}function qe(e,t=""){let n={},r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],a=e[i],u=t?`${t}.${i}`:i;if(Le(a)&&Object.keys(a).length>0){Object.assign(n,qe(a,u));continue}if(Array.isArray(a)){for(let s=0;s<a.length;s++)n[`${u}.${s}`]=a[s];continue}n[u]=a}return n}function V(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||p(n,r).length!==n.length)return!1;for(let o=0;o<n.length;o++){let i=n[o],a=e[i],u=t[i];if(!V(a,u))return!1}return!0}function je(e){return e==null}function $e(e){return e!=null}function Ge(e){return e===null}function Xe(e){return e===void 0}function E(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function Ye(e){return typeof e=="function"}function He(e){return e!=null&&typeof e!="function"&&E(e.length)}function Ze(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function Je(e){return e==null||typeof e!="object"&&typeof e!="function"}function F(e,{signal:t}={}){return new Promise((n,r)=>{let o=()=>{r(new T)},i=()=>{clearTimeout(a),o()};if(t?.aborted)return o();let a=setTimeout(n,e);t?.addEventListener("abort",i,{once:!0})})}async function Qe(e){throw await F(e),new m}async function et(e,t){return Promise.race([e(),Qe(t)])}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var Rt=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){return Array.from(e.match(Rt)??[])}function tt(e){let t=l(e);if(t.length===0)return"";let[n,...r]=t;return`${n.toLowerCase()}${r.map(o=>D(o)).join("")}`}var nt=e=>l(e).map(n=>n.toLowerCase()).join("_");var rt=e=>l(e).map(n=>n.toLowerCase()).join("-");var ot=e=>l(e).map(n=>n.toLowerCase()).join(" ");function it(e){let t=l(e.trim()),n="";for(let r of t)n&&(n+=" "),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase();return n}function at(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:z(e,t)}function ut(...e){return f(e)}function st(e,...t){let n=e,r=f(t);return x(n,r)}function ft(e,t,n=0,r=e.length){return n=Math.floor(n),r=Math.floor(r),n||(n=0),r||(r=0),X(e,t,n,r)}var vt=/^(?:0|[1-9]\d*)$/;function lt(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return vt.test(e)}}function M(e){let t=/\\(\\)?/g,n=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),r=[];e[0]==="."&&r.push("");let o,i=0;for(;(o=n.exec(e))!==null;){let a=o[0],u=o[1],s=o[2],W=o[3];s?a=W.replace(t,"$1"):u&&(a=u),r.push(a),n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}function B(e,t,n){let r=Array.isArray(t)?t:typeof t=="string"?M(t):[t],o=e;for(let a=0;a<r.length-1;a++){let u=r[a],s=r[a+1];o[u]==null&&(o[u]=lt(s)?[]:{}),o=o[u]}let i=r[r.length-1];return o[i]=n,e}function ct(e,t){let n={},r=I(e,t);for(let o=0;o<r.length;o++){let[i,a]=r[o];i!=null&&B(n,i,a)}return n}var Pt=/^\w*$/,It=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function pt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!Pt.test(e)&&It.test(e)}}function Tt(e,t,n){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&pt(t)&&e?.[t]==null?r=M(t):r=[t],r.length===0)return n;let o=e,i;for(i=0;i<r.length&&o!=null;i++){let a=r[i];Object.is(a.valueOf(),-0)&&(a="-0"),o=o[a]}return o===null&&i===r.length?o:o??n}function mt(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let n=e[Symbol.toStringTag];return n==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${n}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function yt(e){return Array.isArray(e)}function dt(e){return Ze(e)}var xt=(e,t,n=0)=>e.startsWith(t,n);var gt=(e,t,n=e.length)=>e.endsWith(t,n);function ht(e=[]){let t=e[0],n;for(let r of e)(n==null||r>n)&&(n=r,t=r);return t}function bt(e=[]){let t=e[0],n;for(let r of e)(n==null||r<n)&&(n=r,t=r);return t}window._=N;})();
|
|
1
|
+
"use strict";(()=>{var Kt=Object.defineProperty;var At=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})};var N={};At(N,{AbortError:()=>T,TimeoutError:()=>m,after:()=>we,camelCase:()=>tt,capitalize:()=>D,chunk:()=>at,clamp:()=>Oe,clone:()=>ze,cloneDeep:()=>c,compact:()=>L,concat:()=>ut,countBy:()=>_,debounce:()=>Ue,delay:()=>F,difference:()=>ft,differenceBy:()=>g,differenceWith:()=>h,drop:()=>q,dropRight:()=>$,dropRightWhile:()=>G,dropWhile:()=>j,endsWith:()=>gt,fill:()=>st,first:()=>S,flatMap:()=>Y,flatten:()=>s,flattenDeep:()=>H,flattenObject:()=>_e,forEachRight:()=>Z,get:()=>Tt,groupBy:()=>J,head:()=>S,inRange:()=>Ee,initial:()=>ke,intersection:()=>b,intersectionBy:()=>K,intersectionWith:()=>A,invert:()=>Ce,isArray:()=>yt,isArrayLike:()=>He,isEqual:()=>V,isFunction:()=>Ye,isLength:()=>E,isNil:()=>$e,isNotNil:()=>Ge,isNull:()=>je,isPlainObject:()=>mt,isPrimitive:()=>Je,isTypedArray:()=>dt,isUndefined:()=>Xe,kebabCase:()=>rt,keyBy:()=>Q,last:()=>Ae,lowerCase:()=>ot,max:()=>ht,maxBy:()=>ee,mean:()=>O,meanBy:()=>Fe,min:()=>bt,minBy:()=>te,negate:()=>Ie,noop:()=>Re,omit:()=>We,omitBy:()=>Se,once:()=>ve,orderBy:()=>ne,partition:()=>re,pick:()=>Ve,pickBy:()=>Ne,random:()=>k,randomInt:()=>w,range:()=>Be,round:()=>De,sample:()=>oe,sampleSize:()=>ie,set:()=>B,shuffle:()=>ae,snakeCase:()=>nt,startCase:()=>it,startsWith:()=>xt,sum:()=>y,sumBy:()=>Me,tail:()=>be,take:()=>ue,takeRight:()=>fe,takeRightWhile:()=>se,takeWhile:()=>le,throttle:()=>Pe,toFilled:()=>Ke,union:()=>p,unionBy:()=>R,unionWith:()=>P,uniq:()=>U,uniqBy:()=>ce,uniqWith:()=>v,unzip:()=>pe,unzipWith:()=>Te,withTimeout:()=>et,without:()=>he,xor:()=>me,xorBy:()=>ye,xorWith:()=>de,zip:()=>I,zipObject:()=>xe,zipObjectDeep:()=>ct,zipWith:()=>ge});function z(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");let n=Math.ceil(e.length/t),r=Array(n);for(let o=0;o<n;o++){let i=o*t,a=i+t;r[o]=e.slice(i,a)}return r}function L(e){let t=[];for(let n of e)n&&t.push(n);return t}function _(e,t){let n={};for(let r of e){let o=t(r);n[o]=(n[o]??0)+1}return n}function x(e,t){let n=new Set(t);return e.filter(r=>!n.has(r))}function g(e,t,n){let r=new Set(t.map(o=>n(o)));return e.filter(o=>!r.has(n(o)))}function h(e,t,n){return e.filter(r=>t.every(o=>!n(r,o)))}function q(e,t){return t=Math.max(t,0),e.slice(t)}function $(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function G(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(0,n+1);return[]}function j(e,t){let n=e.findIndex(r=>!t(r));return n===-1?[]:e.slice(n)}function X(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),a=Math.min(r>=0?r:o+r,o);for(let u=i;u<a;u++)e[u]=t;return e}function s(e,t=1){let n=[],r=Math.floor(t),o=(i,a)=>{for(let u of i)Array.isArray(u)&&a<r?o(u,a+1):n.push(u)};return o(e,0),n}function Y(e,t,n=1){return s(e.map(r=>t(r)),n)}function H(e){return s(e,1/0)}function Z(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];t(r,n,e)}}function J(e,t){let n={};for(let r of e){let o=t(r);n[o]==null&&(n[o]=[]),n[o].push(r)}return n}function b(e,t){let n=new Set(t);return e.filter(r=>n.has(r))}function K(e,t,n){let r=new Set(t.map(n));return e.filter(o=>r.has(n(o)))}function A(e,t,n){return e.filter(r=>t.some(o=>n(r,o)))}function Q(e,t){let n={};for(let r of e){let o=t(r);n[o]=r}return n}function ee(e,t){let n=e[0],r=-1/0;for(let o of e){let i=t(o);i>r&&(r=i,n=o)}return n}function te(e,t){let n=e[0],r=1/0;for(let o of e){let i=t(o);i<r&&(r=i,n=o)}return n}function ne(e,t,n){let r=(i,a,u)=>i<a?u==="asc"?-1:1:i>a?u==="asc"?1:-1:0,o=t.map((i,a)=>n[a]||n[n.length-1]);return e.slice().sort((i,a)=>{for(let u=0;u<t.length;u++){let f=t[u],W=o[u],C=r(i[f],a[f],W);if(C!==0)return C}return 0})}function re(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return[n,r]}function oe(e){let t=Math.floor(Math.random()*e.length);return e[t]}function k(e,t){if(t==null&&(t=e,e=0),e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function w(e,t){return Math.floor(k(e,t))}function ie(e,t){if(t>e.length)throw new Error("Size must be less than or equal to the length of array.");let n=new Array(t),r=new Set;for(let o=e.length-t,i=0;o<e.length;o++,i++){let a=w(0,o+1);r.has(a)&&(a=o),r.add(a),n[i]=e[a]}return n}function ae(e){let t=e.slice();for(let n=t.length-1;n>=1;n--){let r=Math.floor(Math.random()*(n+1));[t[n],t[r]]=[t[r],t[n]]}return t}function ue(e,t){return e.slice(0,t)}function fe(e,t=1){return t<=0?[]:e.slice(-t)}function se(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(n+1);return e.slice()}function le(e,t){let n=[];for(let r of e){if(!t(r))break;n.push(r)}return n}function U(e){return Array.from(new Set(e))}function p(e,t){return U(e.concat(t))}function R(e,t,n){let r=new Map;for(let o of[...e,...t]){let i=n(o);r.has(i)||r.set(i,o)}return Array.from(r.values())}function v(e,t){let n=[];for(let r of e)n.every(i=>!t(i,r))&&n.push(r);return n}function P(e,t,n){return v(e.concat(t),n)}function ce(e,t){let n=new Map;for(let r of e){let o=t(r);n.has(o)||n.set(o,r)}return Array.from(n.values())}function pe(e){let t=0;for(let r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length);let n=new Array(t);for(let r=0;r<t;r++){n[r]=new Array(e.length);for(let o=0;o<e.length;o++)n[r][o]=e[o][r]}return n}function Te(e,t){let n=Math.max(...e.map(o=>o.length)),r=new Array(n);for(let o=0;o<n;o++){let i=new Array(e.length);for(let a=0;a<e.length;a++)i[a]=e[a][o];r[o]=t(...i)}return r}function me(e,t){return x(p(e,t),b(e,t))}function ye(e,t,n){let r=R(e,t,n),o=K(e,t,n);return g(r,o,n)}function de(e,t,n){let r=P(e,t,n),o=A(e,t,n);return h(r,o,n)}function I(...e){let t=[],n=Math.max(...e.map(r=>r.length));for(let r=0;r<n;r++){let o=[];for(let i of e)o.push(i[r]);t.push(o)}return t}function xe(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=t[r];return n}function ge(e,...t){let n=[e,...t.slice(0,-1)],r=t[t.length-1],o=[],i=Math.max(...n.map(a=>a.length));for(let a=0;a<i;a++){let u=n.map(f=>f[a]);o.push(r(...u))}return o}function he(e,...t){let n=new Set(t);return e.filter(r=>!n.has(r))}function S(e){return e[0]}function be(e){let t=e.length;if(t<=1)return[];let n=new Array(t-1);for(let r=1;r<t;r++)n[r-1]=e[r];return n}function Ke(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),a=Math.min(r>=0?r:o+r,o),u=e.slice();for(let f=i;f<a;f++)u[f]=t;return u}function Ae(e){return e[e.length-1]}function ke(e){return e.length<=1?[]:e.slice(0,-1)}var T=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var m=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};var we=(e,t)=>{if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n>=e)return t(...r)}};function Ue(e,t,{signal:n}={}){let r=null,o=function(...a){r!==null&&clearTimeout(r),!n?.aborted&&(r=setTimeout(()=>{e(...a),r=null},t))},i=function(){o.cancel()};return o.cancel=function(){r!==null&&(clearTimeout(r),r=null)},n?.addEventListener("abort",i,{once:!0}),o}function Re(){}function ve(e){let t=!1,n;return function(){if(t)return n;let r=e();return t=!0,n=r,r}}function Pe(e,t){let n;return function(...o){let i=Date.now();(n==null||i-n>=t)&&(n=i,e(...o))}}function Ie(e){return(...t)=>!e(...t)}function Oe(e,t,n){return n==null?Math.min(e,t):Math.min(Math.max(e,t),n)}function Ee(e,t,n){if(n==null&&(n=t,t=0),t>=n)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&e<n}function y(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function O(e){return y(e)/e.length}function Fe(e,t){let n=e.map(r=>t(r));return O(n)}function De(e,t=0){if(!Number.isInteger(t))throw new Error("Precision must be an integer.");let n=Math.pow(10,t);return Math.round(e*n)/n}function Me(e,t){let n=e.map(r=>t(r));return y(n)}function Be(e,t,n){if(t==null&&(t=e,e=0),n==null&&(n=1),!Number.isInteger(n)||n===0)throw new Error("The step value must be a non-zero integer.");let r=Math.max(Math.ceil((t-e)/n),0),o=new Array(r);for(let i=0;i<r;i++)o[i]=e+i*n;return o}function We(e,t){let n={...e};for(let r of t)delete n[r];return n}function Se(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)||(n[r]=o);return n}function Ve(e,t){let n={};for(let r of t)n[r]=e[r];return n}function Ne(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)&&(n[r]=o);return n}function Ce(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let o=n[r],i=e[o];t[i]=o}return t}function ze(e){if(kt(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[n,r]of e)t.set(n,r);return t}if(e instanceof Set){let t=new Set;for(let n of e)t.add(n);return t}if(typeof e=="object"){let t=Object.getPrototypeOf(e),n=Object.create(t);return Object.assign(n,e)}return e}function kt(e){return e==null||typeof e!="object"&&typeof e!="function"}function c(e){if(wt(e))return e;if(Array.isArray(e))return e.map(t=>c(t));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[n,r]of e.entries())t.set(n,c(r));return t}if(e instanceof Set){let t=new Set;for(let n of e.values())t.add(c(n));return t}if(Ut(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);for(let n=0;n<e.length;n++)t[n]=c(e[n]);return t}if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0));return d(e,t),t}if(typeof File<"u"&&e instanceof File){let t=new File([e],e.name,{type:e.type});return d(e,t),t}if(e instanceof Blob){let t=new Blob([e],{type:e.type});return d(e,t),t}if(e instanceof Error){let t=new e.constructor;return t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,d(e,t),t}if(typeof e=="object"&&e!==null){let t={};return d(e,t),t}if(typeof e!="function")return e}function wt(e){return e==null||typeof e!="object"&&typeof e!="function"}function d(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=Object.getOwnPropertyDescriptor(e,n);(r?.writable||r?.set)&&typeof r?.value!="function"&&(t[n]=c(e[n]))}}function Ut(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function Le(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _e(e){return qe(e)}function qe(e,t=""){let n={},r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],a=e[i],u=t?`${t}.${i}`:i;if(Le(a)&&Object.keys(a).length>0){Object.assign(n,qe(a,u));continue}if(Array.isArray(a)){for(let f=0;f<a.length;f++)n[`${u}.${f}`]=a[f];continue}n[u]=a}return n}function V(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||p(n,r).length!==n.length)return!1;for(let o=0;o<n.length;o++){let i=n[o],a=e[i],u=t[i];if(!V(a,u))return!1}return!0}function $e(e){return e==null}function Ge(e){return e!=null}function je(e){return e===null}function Xe(e){return e===void 0}function E(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function Ye(e){return typeof e=="function"}function He(e){return e!=null&&typeof e!="function"&&E(e.length)}function Ze(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof BigUint64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof BigInt64Array||e instanceof Float32Array||e instanceof Float64Array}function Je(e){return e==null||typeof e!="object"&&typeof e!="function"}function F(e,{signal:t}={}){return new Promise((n,r)=>{let o=()=>{r(new T)},i=()=>{clearTimeout(a),o()};if(t?.aborted)return o();let a=setTimeout(n,e);t?.addEventListener("abort",i,{once:!0})})}async function Qe(e){throw await F(e),new m}async function et(e,t){return Promise.race([e(),Qe(t)])}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var Rt=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){return Array.from(e.match(Rt)??[])}function tt(e){let t=l(e);if(t.length===0)return"";let[n,...r]=t;return`${n.toLowerCase()}${r.map(o=>D(o)).join("")}`}var nt=e=>l(e).map(n=>n.toLowerCase()).join("_");var rt=e=>l(e).map(n=>n.toLowerCase()).join("-");var ot=e=>l(e).map(n=>n.toLowerCase()).join(" ");function it(e){let t=l(e.trim()),n="";for(let r of t)n&&(n+=" "),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase();return n}function at(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:z(e,t)}function ut(...e){return s(e)}function ft(e,...t){let n=e,r=s(t);return x(n,r)}function st(e,t,n=0,r=e.length){return n=Math.floor(n),r=Math.floor(r),n||(n=0),r||(r=0),X(e,t,n,r)}var vt=/^(?:0|[1-9]\d*)$/;function lt(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return vt.test(e)}}function M(e){let t=/\\(\\)?/g,n=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),r=[];e[0]==="."&&r.push("");let o,i=0;for(;(o=n.exec(e))!==null;){let a=o[0],u=o[1],f=o[2],W=o[3];f?a=W.replace(t,"$1"):u&&(a=u),r.push(a),n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}function B(e,t,n){let r=Array.isArray(t)?t:typeof t=="string"?M(t):[t],o=e;for(let a=0;a<r.length-1;a++){let u=r[a],f=r[a+1];o[u]==null&&(o[u]=lt(f)?[]:{}),o=o[u]}let i=r[r.length-1];return o[i]=n,e}function ct(e,t){let n={},r=I(e,t);for(let o=0;o<r.length;o++){let[i,a]=r[o];i!=null&&B(n,i,a)}return n}var Pt=/^\w*$/,It=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function pt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!Pt.test(e)&&It.test(e)}}function Tt(e,t,n){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&pt(t)&&e?.[t]==null?r=M(t):r=[t],r.length===0)return n;let o=e,i;for(i=0;i<r.length&&o!=null;i++){let a=r[i];Object.is(a.valueOf(),-0)&&(a="-0"),o=o[a]}return o===null&&i===r.length?o:o??n}function mt(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let n=e[Symbol.toStringTag];return n==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${n}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function yt(e){return Array.isArray(e)}function dt(e){return Ze(e)}var xt=(e,t,n=0)=>e.startsWith(t,n);var gt=(e,t,n=e.length)=>e.endsWith(t,n);function ht(e=[]){let t=e[0],n;for(let r of e)(n==null||r>n)&&(n=r,t=r);return t}function bt(e=[]){let t=e[0],n;for(let r of e)(n==null||r<n)&&(n=r,t=r);return t}window._=N;})();
|
|
2
2
|
//# sourceMappingURL=browser.global.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isEqual.ts"],"sourcesContent":["import { union } from \"../array/union.ts\";\n\n/**\n * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.\n *\n * @param {unknown} a - The first value to compare.\n * @param {unknown} b - The second value to compare.\n * @returns {boolean} `true` if the values are equal, otherwise `false`.\n *\n * @example\n * isEqual(1, 1); // true\n * isEqual({ a: 1 }, { a: 1 }); // true\n * isEqual(/abc/g, /abc/g); // true\n * isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n\n const aKeys = Object.keys(a as object);\n const bKeys = Object.keys(b as object);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n // check if all keys in both arrays match\n if (union(aKeys, bKeys).length !== aKeys.length) {\n return false;\n }\n\n for (let i = 0; i < aKeys.length; i++) {\n const propKey = aKeys[i];\n const aProp = (a as any)[propKey];\n const bProp = (b as any)[propKey];\n \n if (!isEqual(aProp, bProp)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;;AAgBO,SAAS,QAAQ,GAAY,GAAqB;AACvD,MAAI,OAAO,GAAG,GAAG,CAAC,GAAG;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,QAAQ,aAAa,MAAM;AAC1C,WAAO,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAAA,EACnC;AAEA,MAAI,aAAa,UAAU,aAAa,QAAQ;AAC9C,WAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE;AAAA,EAChD;AAEA,MAAI,OAAO,MAAM,YAAY,OAAO,MAAM,YAAY,MAAM,QAAQ,MAAM,MAAM;AAC9E,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,OAAO,KAAK,CAAW;AACrC,QAAM,QAAQ,OAAO,KAAK,CAAW;AAErC,MAAI,MAAM,WAAW,MAAM,QAAQ;AACjC,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,OAAO,KAAK,EAAE,WAAW,MAAM,QAAQ;AAC/C,WAAO;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,UAAU,MAAM,CAAC;AACvB,UAAM,QAAS,EAAU,OAAO;AAChC,UAAM,QAAS,EAAU,OAAO;AAEhC,QAAI,CAAC,QAAQ,OAAO,KAAK,GAAG;AAC1B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compat/index.ts","../src/compat/array/chunk.ts","../src/compat/array/concat.ts","../src/compat/array/difference.ts","../src/compat/array/fill.ts","../src/compat/_internal/isIndex.ts","../src/compat/_internal/toPath.ts","../src/compat/object/set.ts","../src/compat/array/zipObjectDeep.ts","../src/compat/_internal/isDeepKey.ts","../src/compat/object/get.ts","../src/compat/predicate/isPlainObject.ts","../src/compat/predicate/isArray.ts","../src/compat/predicate/isTypedArray.ts","../src/compat/string/startsWith.ts","../src/compat/string/endsWith.ts","../src/compat/math/max.ts","../src/compat/math/min.ts"],"sourcesContent":["/**\n * es-toolkit compatibility layer with lodash (WIP)\n * ====================================\n * ```tsx\n * // es-toolkit/compat aims to provide 100% feature parity with lodash\n * import { chunk } from 'es-toolkit/compat';\n *\n * chunk([1, 2, 3, 4], 0);\n * // Returns [], which is identical to lodash\n * ```\n *\n * `es-toolkit/compat` will offer complete compatibility with lodash, ensuring a seamless transition.\n *\n * To guarantee identical behavior, `es-toolkit/compat` will be thoroughly tested using actual lodash test cases.\n *\n * The primary goal of `es-toolkit/compat` is to serve as a drop-in replacement for lodash.\n *\n * It's important to note that while `es-toolkit/compat` will mirror the behavior of lodash functions with 100% accuracy,\n * it will deliberately omit unsafe features, such as:\n *\n * - Implicit type casting from an empty string `''` to 0 or false, and similar cases.\n *\n * @module\n */\nexport * from '../index.ts';\n\nexport { chunk } from './array/chunk.ts';\nexport { concat } from './array/concat.ts';\nexport { difference } from './array/difference.ts';\nexport { fill } from './array/fill.ts';\nexport { zipObjectDeep } from './array/zipObjectDeep.ts';\nexport { head as first } from '../index.ts';\n\nexport { get } from './object/get.ts';\nexport { set } from './object/set.ts';\n\nexport { isPlainObject } from './predicate/isPlainObject.ts';\nexport { isArray } from './predicate/isArray.ts';\nexport { isTypedArray } from './predicate/isTypedArray.ts';\n\nexport { startsWith } from './string/startsWith.ts';\nexport { endsWith } from './string/endsWith.ts';\n\nexport { max } from './math/max.ts';\nexport { min } from './math/min.ts';\n","import { chunk as chunkToolkit } from '../../array/chunk.ts';\n\n/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: readonly T[], size = 1): T[][] {\n size = Math.max(Math.floor(size), 0);\n\n if (size === 0) {\n return [];\n }\n\n return chunkToolkit(arr, size);\n}\n","import { flatten } from '../../array/flatten.ts';\n\n/**\n * Concatenates multiple arrays and values into a single array.\n *\n * @template T The type of elements in the array.\n * @param {...(T | T[])} values - The values and/or arrays to concatenate.\n * @returns {T[]} A new array containing all the input values.\n *\n * @example\n * // Concatenate individual values\n * concat(1, 2, 3);\n * // returns [1, 2, 3]\n *\n * @example\n * // Concatenate arrays of values\n * concat([1, 2], [3, 4]);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate a mix of individual values and arrays\n * concat(1, [2, 3], 4);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate nested arrays\n * concat([1, [2, 3]], 4);\n * // returns [1, [2, 3], 4]\n */\nexport function concat<T>(...values: Array<T | readonly T[]>): T[] {\n return flatten(values) as T[];\n}\n","import { difference as differenceToolkit } from '../../array/difference.ts';\nimport { flatten } from '../../array/flatten.ts';\n\nexport function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[] {\n const arr1 = arr;\n const arr2 = flatten(values);\n\n return differenceToolkit(arr1, arr2);\n}","import { fill as fillToolkit } from '../../array/fill.ts';\n\n/**\n * Fills elements of an array with a specified value from the start position up to, but not including, the end position.\n *\n * This function mutates the original array and replaces its elements with the provided value, starting from the specified\n * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the\n * entire array.\n *\n * @template T, U, S, V\n * @param {Array<T | U>} array - The array to fill.\n * @param {U} value - The value to fill the array with.\n * @param {S} [start=0] - The start position. Defaults to 0.\n * @param {V} [end=arr.length] - The end position. Defaults to the array's length.\n * @returns {Array<T | U>} The array with the filled values.\n *\n * @example\n * const array = [1, 2, 3];\n * const result = fill(array, 'a');\n * // => ['a', 'a', 'a']\n *\n * const result = fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * const result = fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n *\n * const result = fill(array, '*', -2, -1);\n * // => [1, '*', 3]\n */\nexport function fill<T>(array: unknown[], value?: T): T[];\nexport function fill<T, U, S>(array: Array<T | U>, value: U, start: S): Array<T | U>;\nexport function fill<T, U, S, V>(array: Array<T | U>, value: U, start: S, end: V): Array<T | U>;\nexport function fill<T, U>(array: Array<T | U>, value: U, start = 0, end = array.length): Array<T | U> {\n start = Math.floor(start);\n end = Math.floor(end);\n\n if (!start) {\n start = 0;\n }\n if (!end) {\n end = 0;\n }\n\n return fillToolkit(array, value, start, end);\n}\n","const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/\n\nexport function isIndex(value: PropertyKey) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}","/**\n * Converts a deep key string into an array of path segments.\n *\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @param {string} deepKey - The deep key string to convert.\n * @returns {string[]} An array of strings, each representing a segment of the path.\n *\n * Examples:\n *\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n */\nexport function toPath(deepKey: string): string[] {\n const ESCAPE_REGEXP = /\\\\(\\\\)?/g;\n const PROPERTY_REGEXP = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n );\n\n const result: string[] = [];\n\n if (deepKey[0] === '.') {\n result.push('');\n }\n\n let match: RegExpExecArray | null;\n let lastIndex = 0;\n\n while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {\n let key = match[0];\n const expr = match[1];\n const quote = match[2];\n const substr = match[3];\n\n if (quote) {\n key = substr.replace(ESCAPE_REGEXP, '$1');\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n\n if (PROPERTY_REGEXP.lastIndex === lastIndex) {\n PROPERTY_REGEXP.lastIndex++;\n } else {\n lastIndex = PROPERTY_REGEXP.lastIndex;\n }\n }\n\n return result;\n}\n","import { isIndex } from \"../_internal/isIndex.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\n\n/**\n * Sets the value at the specified path of the given object. If any part of the path does not exist, it will be created.\n *\n * @template T - The type of the object.\n * @param {Settable} obj - The object to modify.\n * @param {Path} path - The path of the property to set.\n * @param {any} value - The value to set.\n * @returns {T} - The modified object.\n *\n * @example\n * // Set a value in a nested object\n * const obj = { a: { b: { c: 3 } } };\n * set(obj, 'a.b.c', 4);\n * console.log(obj.a.b.c); // 4\n *\n * @example\n * // Set a value in an array\n * const arr = [1, 2, 3];\n * set(arr, 1, 4);\n * console.log(arr[1]); // 4\n *\n * @example\n * // Create non-existent path and set value\n * const obj = {};\n * set(obj, 'a.b.c', 4);\n * console.log(obj); // { a: { b: { c: 4 } } }\n */\nexport function set<T>(obj: object, path: PropertyKey | readonly PropertyKey[], value: unknown): T;\nexport function set<T extends object>(obj: T, path: PropertyKey | readonly PropertyKey[], value: unknown): T {\n const resolvedPath = Array.isArray(path)\n ? path\n : typeof path === 'string'\n ? toPath(path)\n : [path];\n\n let current: any = obj;\n\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n\n if (current[key] == null) {\n current[key] = isIndex(nextKey) ? [] : {};\n }\n\n current = current[key];\n }\n\n const lastKey = resolvedPath[resolvedPath.length - 1];\n current[lastKey] = value;\n\n return obj;\n}\n","import { zip } from \"../../array/zip.ts\";\nimport { set } from \"../object/set.ts\";\n\n/**\n * Creates a deeply nested object given arrays of paths and values.\n *\n * This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.\n * It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.\n * Paths can be dot-separated strings or arrays of property names.\n * \n * If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.\n *\n * @template V - The type of elements in the array.\n * @param {string[] | string[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.\n * @param {V[]} values - An array of values corresponding to the property paths.\n * @returns {object} A new object composed of the given property paths and values.\n *\n * @example\n * const paths = ['a.b.c', 'd.e.f'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n *\n * @example\n * const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n * \n * @example\n * const paths = ['a.b[0].c', 'a.b[1].d'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\nexport function zipObjectDeep<P extends string | number | symbol, V>(keys: P[], values: V[]): { [K in P]: V } {\n const result = {} as { [K in P]: V };\n const zipped = zip(keys, values);\n\n for (let i = 0; i < zipped.length; i++) {\n const [key, value] = zipped[i];\n\n if (key != null) {\n set(result, key, value);\n }\n }\n\n return result;\n}\n","const IS_PLAIN = /^\\w*$/;\nconst IS_DEEP = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @param {PropertyKey} key - The key to check.\n * @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n *\n * Examples:\n *\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n */\nexport function isDeepKey(key: PropertyKey): boolean {\n switch (typeof key) {\n case 'number':\n case 'symbol': {\n return false;\n }\n case 'string': {\n return !IS_PLAIN.test(key) && IS_DEEP.test(key);\n }\n }\n}\n","import { isDeepKey } from \"../_internal/isDeepKey.ts\";\nimport { toPath } from \"../_internal/toPath.ts\";\nimport type { Get } from \"./get.types.ts\";\n\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K]} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T, path: K | [K]): T[K];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @returns {T[K] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T>(object: T | null | undefined, path: K | [K]): T[K] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K - The type of the key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {K | [K]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K extends keyof T, D>(object: T | null | undefined, path: K | [K], defaultValue: D): Exclude<T[K], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T, path: [K1, K2]): T[K1][K2];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @returns {T[K1][K2] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1]>(object: T | null | undefined, path: [K1, K2]): T[K1][K2] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], D>(object: T | null | undefined, path: [K1, K2], defaultValue: D): Exclude<T[K1][K2], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T, path: [K1, K2, K3]): T[K1][K2][K3];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @returns {T[K1][K2][K3] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(object: T | null | undefined, path: [K1, K2, K3]): T[K1][K2][K3] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], D>(object: T | null | undefined, path: [K1, K2, K3], defaultValue: D): Exclude<T[K1][K2][K3], undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4]} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4];\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @returns {T[K1][K2][K3][K4] | undefined} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3]>(object: T | null | undefined, path: [K1, K2, K3, K4]): T[K1][K2][K3][K4] | undefined;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template K1 - The type of the first key in the object.\n * @template K2 - The type of the second key in the object.\n * @template K3 - The type of the third key in the object.\n * @template K4 - The type of the fourth key in the object.\n * @template D - The type of the default value.\n * \n * @param {T | null | undefined} object - The object to query.\n * @param {[K1, K2, K3, K4]} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<T[K1][K2][K3][K4], undefined> | D} - Returns the resolved value.\n */\nexport function get<T extends object, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2], K4 extends keyof T[K1][K2][K3], D>(object: T | null | undefined, path: [K1, K2, K3, K4], defaultValue: D): Exclude<T[K1][K2][K3][K4], undefined> | D;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T>} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T>, path: number): T;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @returns {T | undefined} - Returns the resolved value.\n */\nexport function get<T>(object: Record<number, T> | null | undefined, path: number): T | undefined;\n/**\n * Retrieves the value at a given path from an object with numeric keys. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the value.\n * @template D - The type of the default value.\n * \n * @param {Record<number, T> | null | undefined} object - The object to query.\n * @param {number} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {T | D} - Returns the resolved value.\n */\nexport function get<T, D>(object: Record<number, T> | null | undefined, path: number, defaultValue: D): T | D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning the default value.\n * \n * @template D - The type of the default value.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {D} - Returns the default value.\n */\nexport function get<D>(object: null | undefined, path: PropertyKey, defaultValue: D): D;\n/**\n * Retrieves the value at a given path from a null or undefined object, returning undefined.\n * \n * @param {null | undefined} object - The object to query.\n * @param {PropertyKey} path - The path of the property to get.\n * @returns {undefined} - Returns undefined.\n */\nexport function get(object: null | undefined, path: PropertyKey): undefined;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @returns {string extends P ? any : Get<T, P>} - Returns the resolved value.\n */\nexport function get<T, P extends string>(data: T, path: P): string extends P ? any : Get<T, P>;\n/**\n * Retrieves the value at a given path from a string-keyed object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @template T - The type of the object.\n * @template P - The type of the path.\n * @template D - The type of the default value.\n * \n * @param {T} data - The object to query.\n * @param {P} path - The path of the property to get.\n * @param {D} defaultValue - The value returned if the resolved value is undefined.\n * @returns {Exclude<Get<T, P>, null | undefined> | D} - Returns the resolved value.\n */\nexport function get<T, P extends string, D = Get<T, P>>(data: T, path: P, defaultValue: D): Exclude<Get<T, P>, null | undefined> | D;\n/**\n * Retrieves the value at a given path from an object. If the resolved value is undefined, the defaultValue is returned instead.\n * \n * @param {unknown} object - The object to query.\n * @param {PropertyKey | readonly PropertyKey[]} path - The path of the property to get.\n * @param {unknown} [defaultValue] - The value returned if the resolved value is undefined.\n * @returns {any} - Returns the resolved value.\n */\nexport function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaultValue?: unknown): any;\nexport function get(object: any, path: PropertyKey | readonly PropertyKey[], defaultValue?: any): any {\n let resolvedPath;\n\n if (Array.isArray(path)) {\n resolvedPath = path;\n } else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {\n resolvedPath = toPath(path);\n } else {\n resolvedPath = [path];\n }\n\n if (resolvedPath.length === 0) {\n return defaultValue;\n }\n\n let current = object;\n let index;\n\n for (index = 0; index < resolvedPath.length && current != null; index++) {\n let key = resolvedPath[index];\n\n if (Object.is(key.valueOf(), -0)) {\n key = '-0';\n }\n\n current = current[key];\n }\n\n if (current === null && index === resolvedPath.length) {\n return current;\n }\n\n return current ?? defaultValue;\n}","/**\n * Checks if a given value is a plain object.\n *\n * A plain object is an object created by the `{}` literal, `new Object()`, or\n * `Object.create(null)`.\n *\n * This function also handles objects with custom\n * `Symbol.toStringTag` properties.\n *\n * `Symbol.toStringTag` is a built-in symbol that a constructor can use to customize the\n * default string description of objects.\n *\n * @param {unknown} [object] - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n *\n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(isPlainObject(new Map())); // false\n */\nexport function isPlainObject(object?: unknown): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const tag = object[Symbol.toStringTag];\n\n if (tag == null) {\n return false;\n }\n\n const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;\n\n if (isTagReadonly) {\n return false;\n }\n\n return object.toString() === `[object ${tag}]`;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}\n","/**\n * Checks if the given value is an array.\n *\n * This function tests whether the provided value is an array or not.\n * It returns `true` if the value is an array, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an array.\n *\n * @template T - The type of value.\n * @param {T} value - The value to test if it is an array.\n * @returns {value is Extract<T, unknown[]>} `true` if the value is an array, `false` otherwise.\n *\n * @example\n * const value1 = [1, 2, 3];\n * const value2 = 'abc';\n * const value3 = () => {};\n *\n * console.log(isArray(value1)); // true\n * console.log(isArray(value2)); // false\n * console.log(isArray(value3)); // false\n */\nexport function isArray<T>(value?: T): value is Extract<T, readonly unknown[]> {\n return Array.isArray(value);\n}\n","import { isTypedArray as isTypedArrayToolkit } from '../../predicate/isTypedArray.ts';\n\n/**\n * Checks if a value is a TypedArray.\n * @param {unknown} x The value to check.\n * @returns {x is\n * | Uint8Array\n * | Uint8ClampedArray\n * | Uint16Array\n * | Uint32Array\n * | BigUint64Array\n * | Int8Array\n * | Int16Array\n * | Int32Array\n * | BigInt64Array\n * | Float32Array\n * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.\n */\nexport function isTypedArray(\n x?: unknown\n): x is\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array {\n return isTypedArrayToolkit(x);\n}\n","/**\n * Checks if a string contains another string at the beginning of the string.\n *\n * Checks if one string startsWith another string. Optional position parameter to start searching from a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional offset to start searching in the str string\n * @returns {boolean} - True if the str string starts with the target string.\n *\n * @example\n * const isPrefix = startsWith('fooBar', 'foo') // returns true\n * const isPrefix = startsWith('fooBar', 'bar') // returns false\n * const isPrefix = startsWith('fooBar', 'abc') // returns false\n * const isPrefix = startsWith('fooBar', 'Bar', 2) // returns true\n * const isPrefix = startsWith('fooBar', 'Bar', 5) // returns false\n */\nexport const startsWith = (str: string, target: string, position = 0): boolean => {\n return str.startsWith(target, position);\n};\n","/**\n * Checks if a string contains another string at the end of the string.\n *\n * Checks if one string endsWith another string. Optional position parameter to offset searching before a certain index.\n *\n * @param {string} str - The string that might contain the target string.\n * @param {string} target - The string to search for.\n * @param {number} position - An optional position from the start to search up to this index\n * @returns {boolean} - True if the str string ends with the target string.\n *\n * @example\n * const isPrefix = endsWith('fooBar', 'foo') // returns true\n * const isPrefix = endsWith('fooBar', 'bar') // returns false\n * const isPrefix = endsWith('fooBar', 'abc') // returns false\n * const isPrefix = endsWith('fooBar', 'foo', 3) // returns true\n * const isPrefix = endsWith('fooBar', 'abc', 5) // returns false\n */\nexport const endsWith = (str: string, target: string, position: number = str.length): boolean => {\n return str.endsWith(target, position);\n};\n","/**\n * Finds the element in an array that has the maximum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T | undefined} The element with the maximum value.\n * @example\n * // Returns 9\n * max([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns 8\n * max([0, -3, 2, 8, 7])\n */\nexport function max<T>(items: readonly [T, ...T[]]): T;\nexport function max(): undefined;\nexport function max<T>(items?: readonly T[]): T | undefined;\nexport function max<T>(items: readonly T[] = []): T | undefined {\n let maxElement = items[0];\n let max = undefined;\n\n for (const element of items) {\n if (max == null || element > max) {\n max = element;\n maxElement = element;\n }\n }\n\n return maxElement;\n}\n","/**\n * Finds the element in an array that has the minimum value.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items The array of elements to search.\n * @returns {T | undefined} The element with the minimum value.\n * @example\n * // Returns 1\n * min([3, 1, 4, 1, 5, 9])\n *\n * @example\n * // Returns -3\n * min([0, -3, 2, 8, 7])\n */\nexport function min<T>(items: readonly [T, ...T[]]): T;\nexport function min(): undefined;\nexport function min<T>(items?: readonly T[]): T | undefined;\nexport function min<T>(items: readonly T[] = []): T {\n let minElement = items[0];\n let min = undefined;\n\n for (const element of items) {\n if (min == null || element < min) {\n min = element;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AA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