es-toolkit 1.13.1-dev.317 → 1.13.1-dev.320

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.
Files changed (58) hide show
  1. package/dist/array/index.mjs +49 -49
  2. package/dist/browser.js +101 -0
  3. package/dist/browser.js.map +1 -1
  4. package/dist/browser.mjs +45 -43
  5. package/dist/browser.mjs.map +1 -1
  6. package/dist/chunk-5CPXZFCB.mjs +93 -0
  7. package/dist/chunk-5CPXZFCB.mjs.map +1 -0
  8. package/dist/chunk-STL6TD3L.mjs +1 -0
  9. package/dist/chunk-SXFMQQ6F.mjs +9 -0
  10. package/dist/chunk-SXFMQQ6F.mjs.map +1 -0
  11. package/dist/{chunk-HKO7DEJK.mjs → chunk-YNJH6GEG.mjs} +98 -84
  12. package/dist/chunk-YNJH6GEG.mjs.map +1 -0
  13. package/dist/chunk-YXAOYIRV.mjs +1 -0
  14. package/dist/compat/index.d.mts +20 -1
  15. package/dist/compat/index.d.ts +20 -1
  16. package/dist/compat/index.js +103 -0
  17. package/dist/compat/index.js.map +1 -1
  18. package/dist/compat/index.mjs +98 -91
  19. package/dist/error/index.mjs +3 -3
  20. package/dist/function/index.mjs +9 -9
  21. package/dist/index.d.mts +2 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +98 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +98 -90
  26. package/dist/object/cloneDeep.d.mts +64 -0
  27. package/dist/object/cloneDeep.d.ts +64 -0
  28. package/dist/object/cloneDeep.js +117 -0
  29. package/dist/object/cloneDeep.js.map +1 -0
  30. package/dist/object/cloneDeep.mjs +8 -0
  31. package/dist/object/cloneDeep.mjs.map +1 -0
  32. package/dist/object/index.d.mts +1 -0
  33. package/dist/object/index.d.ts +1 -0
  34. package/dist/object/index.js +91 -0
  35. package/dist/object/index.js.map +1 -1
  36. package/dist/object/index.mjs +8 -4
  37. package/dist/predicate/index.d.mts +1 -0
  38. package/dist/predicate/index.d.ts +1 -0
  39. package/dist/predicate/index.js +7 -0
  40. package/dist/predicate/index.js.map +1 -1
  41. package/dist/predicate/index.mjs +8 -4
  42. package/dist/predicate/isTypedArray.d.mts +19 -0
  43. package/dist/predicate/isTypedArray.d.ts +19 -0
  44. package/dist/predicate/isTypedArray.js +33 -0
  45. package/dist/predicate/isTypedArray.js.map +1 -0
  46. package/dist/predicate/isTypedArray.mjs +8 -0
  47. package/dist/predicate/isTypedArray.mjs.map +1 -0
  48. package/dist/promise/index.mjs +1 -1
  49. package/dist/promise/timeout.mjs +1 -1
  50. package/dist/promise/withTimeout.mjs +1 -1
  51. package/dist/string/index.mjs +6 -6
  52. package/package.json +1 -1
  53. package/umd/browser.global.js +1 -1
  54. package/dist/chunk-54TK5BIS.mjs +0 -1
  55. package/dist/chunk-HKO7DEJK.mjs.map +0 -1
  56. package/dist/chunk-U4JWMVQK.mjs +0 -1
  57. /package/dist/{chunk-54TK5BIS.mjs.map → chunk-STL6TD3L.mjs.map} +0 -0
  58. /package/dist/{chunk-U4JWMVQK.mjs.map → chunk-YXAOYIRV.mjs.map} +0 -0
@@ -35,6 +35,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
35
35
  var object_exports = {};
36
36
  __export(object_exports, {
37
37
  clone: () => clone,
38
+ cloneDeep: () => cloneDeep,
38
39
  flattenObject: () => flattenObject,
39
40
  invert: () => invert,
40
41
  omit: () => omit,
@@ -137,6 +138,95 @@ function isPrimitive(value) {
137
138
  return value == null || typeof value !== "object" && typeof value !== "function";
138
139
  }
139
140
 
141
+ // src/object/cloneDeep.ts
142
+ function cloneDeep(obj) {
143
+ if (isPrimitive2(obj)) {
144
+ return obj;
145
+ }
146
+ if (Array.isArray(obj)) {
147
+ return obj.map((item) => cloneDeep(item));
148
+ }
149
+ if (obj instanceof Date) {
150
+ return new Date(obj.getTime());
151
+ }
152
+ if (obj instanceof RegExp) {
153
+ return new RegExp(obj.source, obj.flags);
154
+ }
155
+ if (obj instanceof Map) {
156
+ const result = /* @__PURE__ */ new Map();
157
+ for (const [key, value] of obj.entries()) {
158
+ result.set(key, cloneDeep(value));
159
+ }
160
+ return result;
161
+ }
162
+ if (obj instanceof Set) {
163
+ const result = /* @__PURE__ */ new Set();
164
+ for (const value of obj.values()) {
165
+ result.add(cloneDeep(value));
166
+ }
167
+ return result;
168
+ }
169
+ if (isTypedArray(obj)) {
170
+ const result = new (Object.getPrototypeOf(obj)).constructor(obj.length);
171
+ for (let i = 0; i < obj.length; i++) {
172
+ result[i] = cloneDeep(obj[i]);
173
+ }
174
+ return result;
175
+ }
176
+ if (obj instanceof ArrayBuffer || obj instanceof SharedArrayBuffer) {
177
+ return obj.slice(0);
178
+ }
179
+ if (obj instanceof DataView) {
180
+ const result = new DataView(obj.buffer.slice(0));
181
+ cloneDeepHelper(obj, result);
182
+ return result;
183
+ }
184
+ if (typeof File !== "undefined" && obj instanceof File) {
185
+ const result = new File([obj], obj.name, { type: obj.type });
186
+ cloneDeepHelper(obj, result);
187
+ return result;
188
+ }
189
+ if (obj instanceof Blob) {
190
+ const result = new Blob([obj], { type: obj.type });
191
+ cloneDeepHelper(obj, result);
192
+ return result;
193
+ }
194
+ if (obj instanceof Error) {
195
+ const result = new obj.constructor();
196
+ result.message = obj.message;
197
+ result.name = obj.name;
198
+ result.stack = obj.stack;
199
+ result.cause = obj.cause;
200
+ cloneDeepHelper(obj, result);
201
+ return result;
202
+ }
203
+ if (typeof obj === "object" && obj !== null) {
204
+ const result = {};
205
+ cloneDeepHelper(obj, result);
206
+ return result;
207
+ }
208
+ if (typeof obj === "function") {
209
+ return void 0;
210
+ }
211
+ return obj;
212
+ }
213
+ function isPrimitive2(value) {
214
+ return value == null || typeof value !== "object" && typeof value !== "function";
215
+ }
216
+ function cloneDeepHelper(obj, clonedObj) {
217
+ for (const key in obj) {
218
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
219
+ const descriptor = Object.getOwnPropertyDescriptor(obj, key);
220
+ if (((descriptor == null ? void 0 : descriptor.writable) || (descriptor == null ? void 0 : descriptor.set)) && typeof (descriptor == null ? void 0 : descriptor.value) !== "function") {
221
+ clonedObj[key] = cloneDeep(obj[key]);
222
+ }
223
+ }
224
+ }
225
+ }
226
+ function isTypedArray(obj) {
227
+ return obj instanceof Uint8Array || obj instanceof Uint8ClampedArray || obj instanceof Uint16Array || obj instanceof Uint32Array || obj instanceof BigUint64Array || obj instanceof Int8Array || obj instanceof Int16Array || obj instanceof Int32Array || obj instanceof BigInt64Array || obj instanceof Float32Array || obj instanceof Float64Array;
228
+ }
229
+
140
230
  // src/predicate/isPlainObject.ts
141
231
  function isPlainObject(object) {
142
232
  if (typeof object !== "object") {
@@ -186,6 +276,7 @@ function flattenObjectImpl(object, prefix = "") {
186
276
  // Annotate the CommonJS export names for ESM import in node:
187
277
  0 && (module.exports = {
188
278
  clone,
279
+ cloneDeep,
189
280
  flattenObject,
190
281
  invert,
191
282
  omit,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts","../../src/object/invert.ts","../../src/object/clone.ts","../../src/predicate/isPlainObject.ts","../../src/object/flattenObject.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\nexport { invert } from './invert.ts';\nexport { clone } from './clone.ts';\nexport { flattenObject } from './flattenObject.ts';","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Inverts the keys and values of an object. The keys of the input object become the values of the output object and vice versa.\n *\n * This function takes an object and creates a new object by inverting its keys and values. If the input object has duplicate values,\n * the key of the last occurrence will be used as the value for the new key in the output object. It effectively creates a reverse mapping\n * of the input object's key-value pairs.\n *\n * @template K - Type of the keys in the input object (string, number, symbol)\n * @template V - Type of the values in the input object (string, number, symbol)\n * @param {Record<K, V>} obj - The input object whose keys and values are to be inverted\n * @returns {{ [key in V]: K }} - A new object with keys and values inverted\n *\n * @example\n * invert({ a: 1, b: 2, c: 3 }); // { 1: 'a', 2: 'b', 3: 'c' }\n * invert({ 1: 'a', 2: 'b', 3: 'c' }); // { a: '1', b: '2', c: '3' }\n * invert({ a: 1, 2: 'b', c: 3, 4: 'd' }); // { 1: 'a', b: '2', 3: 'c', d: '4' }\n * invert({ a: Symbol('sym1'), b: Symbol('sym2') }); // { [Symbol('sym1')]: 'a', [Symbol('sym2')]: 'b' }\n */\nexport function invert<K extends PropertyKey, V extends PropertyKey>(obj: Record<K, V>): { [key in V]: K } {\n const result = {} as { [key in V]: K };\n\n const keys = Object.keys(obj) as K[];\n \n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = obj[key];\n result[value] = key;\n }\n\n return result;\n}\n","/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === 'object') {\n const prototype = Object.getPrototypeOf(obj);\n const result = Object.create(prototype)\n return Object.assign(result, obj);\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\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}","import { isPlainObject } from \"../predicate/isPlainObject.ts\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n * \n * @param {object} object - The object to flatten.\n * @returns {Record<string, any>} - The flattened object.\n * \n * @example\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n * \n * const flattened = flattenObject(nestedObject);\n * console.log(flattened); \n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n */\nexport function flattenObject(object: object): Record<string, any> {\n return flattenObjectImpl(object);\n}\n\nfunction flattenObjectImpl(object: object, prefix = ''): Record<string, any> {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0) {\n Object.assign(result, flattenObjectImpl(value, prefixedKey));\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n result[`${prefixedKey}.${index}`] = value[index];\n }\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB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,cAAc,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAElD,QAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,EAAE,SAAS,GAAG;AACzD,aAAO,OAAO,QAAQ,kBAAkB,OAAO,WAAW,CAAC;AAC3D;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,eAAO,GAAG,WAAW,IAAI,KAAK,EAAE,IAAI,MAAM,KAAK;AAAA,MACjD;AACA;AAAA,IACF;AAEA,WAAO,WAAW,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts","../../src/object/invert.ts","../../src/object/clone.ts","../../src/object/cloneDeep.ts","../../src/predicate/isPlainObject.ts","../../src/object/flattenObject.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\nexport { invert } from './invert.ts';\nexport { clone } from './clone.ts';\nexport { cloneDeep } from './cloneDeep.ts';\nexport { flattenObject } from './flattenObject.ts';\n","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Inverts the keys and values of an object. The keys of the input object become the values of the output object and vice versa.\n *\n * This function takes an object and creates a new object by inverting its keys and values. If the input object has duplicate values,\n * the key of the last occurrence will be used as the value for the new key in the output object. It effectively creates a reverse mapping\n * of the input object's key-value pairs.\n *\n * @template K - Type of the keys in the input object (string, number, symbol)\n * @template V - Type of the values in the input object (string, number, symbol)\n * @param {Record<K, V>} obj - The input object whose keys and values are to be inverted\n * @returns {{ [key in V]: K }} - A new object with keys and values inverted\n *\n * @example\n * invert({ a: 1, b: 2, c: 3 }); // { 1: 'a', 2: 'b', 3: 'c' }\n * invert({ 1: 'a', 2: 'b', 3: 'c' }); // { a: '1', b: '2', c: '3' }\n * invert({ a: 1, 2: 'b', c: 3, 4: 'd' }); // { 1: 'a', b: '2', 3: 'c', d: '4' }\n * invert({ a: Symbol('sym1'), b: Symbol('sym2') }); // { [Symbol('sym1')]: 'a', [Symbol('sym2')]: 'b' }\n */\nexport function invert<K extends PropertyKey, V extends PropertyKey>(obj: Record<K, V>): { [key in V]: K } {\n const result = {} as { [key in V]: K };\n\n const keys = Object.keys(obj) as K[];\n \n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = obj[key];\n result[value] = key;\n }\n\n return result;\n}\n","/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === 'object') {\n const prototype = Object.getPrototypeOf(obj);\n const result = Object.create(prototype)\n return Object.assign(result, obj);\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n","/**\n * Creates a deep clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A deep clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an array with nested objects\n * const arr = [1, { a: 1 }, [1, 2, 3]];\n * const clonedArr = clone(arr);\n * arr[1].a = 2;\n * console.log(arr); // [2, { a: 2 }, [1, 2, 3]]\n * console.log(clonedArr); // [1, { a: 1 }, [1, 2, 3]]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n *\n * @example\n * // Clone an object with nested objects\n * const obj = { a: 1, b: { c: 1 } };\n * const clonedObj = clone(obj);\n * obj.b.c = 2;\n * console.log(obj); // { a: 1, b: { c: 2 } }\n * console.log(clonedObj); // { a: 1, b: { c: 1 } }\n * console.log(clonedObj === obj); // false\n */\nexport function cloneDeep<T>(obj: T): Resolved<T> {\n if (isPrimitive(obj)) {\n return obj as Resolved<T>;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => cloneDeep(item)) as Resolved<T>;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as Resolved<T>;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as Resolved<T>;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj.entries()) {\n result.set(key, cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj.values()) {\n result.add(cloneDeep(value));\n }\n return result as Resolved<T>;\n }\n\n if (isTypedArray(obj)) {\n const result = new (Object.getPrototypeOf(obj).constructor)(obj.length);\n for (let i = 0; i < obj.length; i++) {\n result[i] = cloneDeep(obj[i]);\n }\n return result as Resolved<T>;\n }\n\n if (obj instanceof ArrayBuffer || obj instanceof SharedArrayBuffer) {\n return obj.slice(0) as Resolved<T>;\n }\n\n if (obj instanceof DataView) {\n const result = new DataView(obj.buffer.slice(0));\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n // For legacy NodeJS support\n if (typeof File !== 'undefined' && obj instanceof File) {\n const result = new File([obj], obj.name, { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Blob) {\n const result = new Blob([obj], { type: obj.type });\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (obj instanceof Error) {\n const result = new (obj.constructor as { new (): Error })();\n result.message = obj.message;\n result.name = obj.name;\n result.stack = obj.stack;\n result.cause = obj.cause;\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'object' && obj !== null) {\n const result = {};\n cloneDeepHelper(obj, result);\n return result as Resolved<T>;\n }\n\n if (typeof obj === 'function') {\n return void 0 as Resolved<T>;\n }\n\n return obj as Resolved<T>;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\n// eslint-disable-next-line\nfunction cloneDeepHelper(obj: any, clonedObj: any): void {\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key);\n if ((descriptor?.writable || descriptor?.set) && typeof descriptor?.value !== 'function') {\n clonedObj[key] = cloneDeep(obj[key]);\n }\n }\n }\n}\n\nfunction isTypedArray(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n obj: any\n): obj 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 obj instanceof Uint8Array ||\n obj instanceof Uint8ClampedArray ||\n obj instanceof Uint16Array ||\n obj instanceof Uint32Array ||\n obj instanceof BigUint64Array ||\n obj instanceof Int8Array ||\n obj instanceof Int16Array ||\n obj instanceof Int32Array ||\n obj instanceof BigInt64Array ||\n obj instanceof Float32Array ||\n obj instanceof Float64Array\n );\n}\n\nexport type Resolved<T> = Equal<T, ResolvedMain<T>> extends true ? T : ResolvedMain<T>;\n\ntype Equal<X, Y> = X extends Y ? (Y extends X ? true : false) : false;\n\ntype ResolvedMain<T> = T extends [never]\n ? never // (special trick for jsonable | null) type\n : ValueOf<T> extends boolean | number | bigint | string\n ? ValueOf<T>\n : T extends (...args: any[]) => any\n ? never\n : T extends object\n ? ResolvedObject<T>\n : ValueOf<T>;\n\ntype ResolvedObject<T extends object> =\n T extends Array<infer U>\n ? IsTuple<T> extends true\n ? ResolvedTuple<T>\n : Array<ResolvedMain<U>>\n : T extends Set<infer U>\n ? Set<ResolvedMain<U>>\n : T extends Map<infer K, infer V>\n ? Map<ResolvedMain<K>, ResolvedMain<V>>\n : T extends WeakSet<any> | WeakMap<any, any>\n ? never\n : T extends\n | Date\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | BigUint64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | BigInt64Array\n | Float32Array\n | Float64Array\n | ArrayBuffer\n | SharedArrayBuffer\n | DataView\n | Blob\n | File\n ? T\n : {\n [P in keyof T]: ResolvedMain<T[P]>;\n };\n\ntype ResolvedTuple<T extends readonly any[]> = T extends []\n ? []\n : T extends [infer F]\n ? [ResolvedMain<F>]\n : T extends [infer F, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>, ...ResolvedTuple<Rest>]\n : T extends [(infer F)?]\n ? [ResolvedMain<F>?]\n : T extends [(infer F)?, ...infer Rest extends readonly any[]]\n ? [ResolvedMain<F>?, ...ResolvedTuple<Rest>]\n : [];\n\ntype IsTuple<T extends readonly any[] | { length: number }> = [T] extends [never]\n ? false\n : T extends readonly any[]\n ? number extends T['length']\n ? false\n : true\n : false;\n\ntype ValueOf<Instance> =\n IsValueOf<Instance, boolean> extends true\n ? boolean\n : IsValueOf<Instance, number> extends true\n ? number\n : IsValueOf<Instance, string> extends true\n ? string\n : Instance;\n\ntype IsValueOf<Instance, O extends IValueOf<any>> = Instance extends O\n ? O extends IValueOf<infer Primitive>\n ? Instance extends Primitive\n ? false\n : true // not Primitive, but Object\n : false // cannot be\n : false;\n\ninterface IValueOf<T> {\n valueOf(): T;\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}","import { isPlainObject } from \"../predicate/isPlainObject.ts\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n * \n * @param {object} object - The object to flatten.\n * @returns {Record<string, any>} - The flattened object.\n * \n * @example\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n * \n * const flattened = flattenObject(nestedObject);\n * console.log(flattened); \n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n */\nexport function flattenObject(object: object): Record<string, any> {\n return flattenObjectImpl(object);\n}\n\nfunction flattenObjectImpl(object: object, prefix = ''): Record<string, any> {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0) {\n Object.assign(result, flattenObjectImpl(value, prefixedKey));\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n result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;AAC3C;;;ACVO,SAAS,cAAc,QAAqC;AACjE,SAAO,kBAAkB,MAAM;AACjC;AAEA,SAAS,kBAAkB,QAAgB,SAAS,IAAyB;AAC3E,QAAM,SAA8B,CAAC;AACrC,QAAM,OAAO,OAAO,KAAK,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,UAAM,QAAS,OAAe,GAAG;AAEjC,UAAM,cAAc,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAElD,QAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,EAAE,SAAS,GAAG;AACzD,aAAO,OAAO,QAAQ,kBAAkB,OAAO,WAAW,CAAC;AAC3D;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,eAAO,GAAG,WAAW,IAAI,KAAK,EAAE,IAAI,MAAM,KAAK;AAAA,MACjD;AACA;AAAA,IACF;AAEA,WAAO,WAAW,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;","names":["isPrimitive"]}
@@ -1,4 +1,7 @@
1
- import "../chunk-54TK5BIS.mjs";
1
+ import "../chunk-YXAOYIRV.mjs";
2
+ import {
3
+ invert
4
+ } from "../chunk-OLX53VEF.mjs";
2
5
  import {
3
6
  omit
4
7
  } from "../chunk-WFZXCGEG.mjs";
@@ -14,16 +17,17 @@ import {
14
17
  import {
15
18
  clone
16
19
  } from "../chunk-VRUTBJYS.mjs";
20
+ import {
21
+ cloneDeep
22
+ } from "../chunk-5CPXZFCB.mjs";
17
23
  import {
18
24
  flattenObject
19
25
  } from "../chunk-XGQWTHW6.mjs";
20
26
  import "../chunk-MIGAC7F4.mjs";
21
- import {
22
- invert
23
- } from "../chunk-OLX53VEF.mjs";
24
27
  import "../chunk-24FKGR6U.mjs";
25
28
  export {
26
29
  clone,
30
+ cloneDeep,
27
31
  flattenObject,
28
32
  invert,
29
33
  omit,
@@ -7,3 +7,4 @@ export { isLength } from './isLength.mjs';
7
7
  export { isPlainObject } from './isPlainObject.mjs';
8
8
  export { isFunction } from './isFunction.mjs';
9
9
  export { isArrayLike } from './isArrayLike.mjs';
10
+ export { isTypedArray } from './isTypedArray.mjs';
@@ -7,3 +7,4 @@ export { isLength } from './isLength.js';
7
7
  export { isPlainObject } from './isPlainObject.js';
8
8
  export { isFunction } from './isFunction.js';
9
9
  export { isArrayLike } from './isArrayLike.js';
10
+ export { isTypedArray } from './isTypedArray.js';
@@ -28,6 +28,7 @@ __export(predicate_exports, {
28
28
  isNotNil: () => isNotNil,
29
29
  isNull: () => isNull,
30
30
  isPlainObject: () => isPlainObject,
31
+ isTypedArray: () => isTypedArray,
31
32
  isUndefined: () => isUndefined
32
33
  });
33
34
  module.exports = __toCommonJS(predicate_exports);
@@ -130,6 +131,11 @@ function isFunction(value) {
130
131
  function isArrayLike(value) {
131
132
  return value != null && typeof value !== "function" && isLength(value.length);
132
133
  }
134
+
135
+ // src/predicate/isTypedArray.ts
136
+ function isTypedArray(x) {
137
+ return x instanceof Uint8Array || x instanceof Uint8ClampedArray || x instanceof Uint16Array || x instanceof Uint32Array || x instanceof BigUint64Array || x instanceof Int8Array || x instanceof Int16Array || x instanceof Int32Array || x instanceof BigInt64Array || x instanceof Float32Array || x instanceof Float64Array;
138
+ }
133
139
  // Annotate the CommonJS export names for ESM import in node:
134
140
  0 && (module.exports = {
135
141
  isArrayLike,
@@ -140,6 +146,7 @@ function isArrayLike(value) {
140
146
  isNotNil,
141
147
  isNull,
142
148
  isPlainObject,
149
+ isTypedArray,
143
150
  isUndefined
144
151
  });
145
152
  //# sourceMappingURL=index.js.map
@@ -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"],"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';\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"],"mappings":";;;;;;;;;;;;;;;;;;;;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;A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O,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;","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"],"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';\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"],"mappings":";;;;;;;;;;;;;;;;;;;;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,MAAM,MAAM;AAC9E,WAAO;A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,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;","names":[]}
@@ -1,4 +1,7 @@
1
- import "../chunk-U4JWMVQK.mjs";
1
+ import "../chunk-STL6TD3L.mjs";
2
+ import {
3
+ isFunction
4
+ } from "../chunk-74CREQXW.mjs";
2
5
  import {
3
6
  isNil
4
7
  } from "../chunk-WMM7TZLG.mjs";
@@ -8,6 +11,9 @@ import {
8
11
  import {
9
12
  isNull
10
13
  } from "../chunk-AIRSKN47.mjs";
14
+ import {
15
+ isTypedArray
16
+ } from "../chunk-SXFMQQ6F.mjs";
11
17
  import {
12
18
  isUndefined
13
19
  } from "../chunk-VH2PV426.mjs";
@@ -20,9 +26,6 @@ import {
20
26
  import {
21
27
  isEqual
22
28
  } from "../chunk-JYSV56US.mjs";
23
- import {
24
- isFunction
25
- } from "../chunk-74CREQXW.mjs";
26
29
  import {
27
30
  isPlainObject
28
31
  } from "../chunk-MIGAC7F4.mjs";
@@ -38,6 +41,7 @@ export {
38
41
  isNotNil,
39
42
  isNull,
40
43
  isPlainObject,
44
+ isTypedArray,
41
45
  isUndefined
42
46
  };
43
47
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Checks if a value is a TypedArray.
3
+ * @param {unknown} x The value to check.
4
+ * @returns {x is
5
+ * | Uint8Array
6
+ * | Uint8ClampedArray
7
+ * | Uint16Array
8
+ * | Uint32Array
9
+ * | BigUint64Array
10
+ * | Int8Array
11
+ * | Int16Array
12
+ * | Int32Array
13
+ * | BigInt64Array
14
+ * | Float32Array
15
+ * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.
16
+ */
17
+ declare function isTypedArray(x: unknown): x is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array;
18
+
19
+ export { isTypedArray };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Checks if a value is a TypedArray.
3
+ * @param {unknown} x The value to check.
4
+ * @returns {x is
5
+ * | Uint8Array
6
+ * | Uint8ClampedArray
7
+ * | Uint16Array
8
+ * | Uint32Array
9
+ * | BigUint64Array
10
+ * | Int8Array
11
+ * | Int16Array
12
+ * | Int32Array
13
+ * | BigInt64Array
14
+ * | Float32Array
15
+ * | Float64Array} Returns true if `x` is a TypedArray, false otherwise.
16
+ */
17
+ declare function isTypedArray(x: unknown): x is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array;
18
+
19
+ export { isTypedArray };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/predicate/isTypedArray.ts
21
+ var isTypedArray_exports = {};
22
+ __export(isTypedArray_exports, {
23
+ isTypedArray: () => isTypedArray
24
+ });
25
+ module.exports = __toCommonJS(isTypedArray_exports);
26
+ function isTypedArray(x) {
27
+ return x instanceof Uint8Array || x instanceof Uint8ClampedArray || x instanceof Uint16Array || x instanceof Uint32Array || x instanceof BigUint64Array || x instanceof Int8Array || x instanceof Int16Array || x instanceof Int32Array || x instanceof BigInt64Array || x instanceof Float32Array || x instanceof Float64Array;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isTypedArray
32
+ });
33
+ //# sourceMappingURL=isTypedArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/predicate/isTypedArray.ts"],"sourcesContent":["/**\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,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;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isTypedArray
3
+ } from "../chunk-SXFMQQ6F.mjs";
4
+ import "../chunk-24FKGR6U.mjs";
5
+ export {
6
+ isTypedArray
7
+ };
8
+ //# sourceMappingURL=isTypedArray.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -6,8 +6,8 @@ import "../chunk-CVVZHOJX.mjs";
6
6
  import {
7
7
  delay
8
8
  } from "../chunk-O64NE2P4.mjs";
9
- import "../chunk-DXB7EZUQ.mjs";
10
9
  import "../chunk-KIOYQRMQ.mjs";
10
+ import "../chunk-DXB7EZUQ.mjs";
11
11
  import "../chunk-24FKGR6U.mjs";
12
12
  export {
13
13
  delay,
@@ -2,8 +2,8 @@ import {
2
2
  timeout
3
3
  } from "../chunk-CVVZHOJX.mjs";
4
4
  import "../chunk-O64NE2P4.mjs";
5
- import "../chunk-DXB7EZUQ.mjs";
6
5
  import "../chunk-KIOYQRMQ.mjs";
6
+ import "../chunk-DXB7EZUQ.mjs";
7
7
  import "../chunk-24FKGR6U.mjs";
8
8
  export {
9
9
  timeout
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-IIDZ3KAJ.mjs";
4
4
  import "../chunk-CVVZHOJX.mjs";
5
5
  import "../chunk-O64NE2P4.mjs";
6
- import "../chunk-DXB7EZUQ.mjs";
7
6
  import "../chunk-KIOYQRMQ.mjs";
7
+ import "../chunk-DXB7EZUQ.mjs";
8
8
  import "../chunk-24FKGR6U.mjs";
9
9
  export {
10
10
  withTimeout
@@ -1,4 +1,10 @@
1
1
  import "../chunk-XT74R35S.mjs";
2
+ import {
3
+ lowerCase
4
+ } from "../chunk-5IKVJGHO.mjs";
5
+ import {
6
+ snakeCase
7
+ } from "../chunk-F3WCQQET.mjs";
2
8
  import {
3
9
  startCase
4
10
  } from "../chunk-QXTNZR7B.mjs";
@@ -11,12 +17,6 @@ import {
11
17
  import {
12
18
  kebabCase
13
19
  } from "../chunk-EYYZQFOP.mjs";
14
- import {
15
- lowerCase
16
- } from "../chunk-5IKVJGHO.mjs";
17
- import {
18
- snakeCase
19
- } from "../chunk-F3WCQQET.mjs";
20
20
  import "../chunk-WVQ7YVRK.mjs";
21
21
  import "../chunk-24FKGR6U.mjs";
22
22
  export {
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.317+bacbf81c",
4
+ "version": "1.13.1-dev.320+2df30f70",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var L=Object.defineProperty;var N=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var z=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))Kt.call(t,n)&&z(e,n,t[n]);if(N)for(var n of N(t))kt.call(t,n)&&z(e,n,t[n]);return e};var wt=(e,t)=>{for(var n in t)L(e,n,{get:t[n],enumerable:!0})};var x=(e,t,n)=>new Promise((r,o)=>{var i=a=>{try{f(n.next(a))}catch(c){o(c)}},u=a=>{try{f(n.throw(a))}catch(c){o(c)}},f=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,u);f((n=n.apply(e,t)).next())});var V={};wt(V,{AbortError:()=>p,TimeoutError:()=>T,after:()=>Re,camelCase:()=>nt,capitalize:()=>D,chunk:()=>ft,clamp:()=>De,clone:()=>_e,compact:()=>q,concat:()=>at,countBy:()=>$,debounce:()=>Ee,delay:()=>W,difference:()=>lt,differenceBy:()=>h,differenceWith:()=>b,drop:()=>G,dropRight:()=>X,dropRightWhile:()=>Z,dropWhile:()=>H,endsWith:()=>ht,fill:()=>st,first:()=>I,flatMap:()=>J,flatten:()=>l,flattenDeep:()=>Q,flattenObject:()=>$e,forEachRight:()=>ee,get:()=>Tt,groupBy:()=>te,head:()=>I,inRange:()=>Se,initial:()=>Pe,intersection:()=>g,intersectionBy:()=>K,intersectionWith:()=>k,invert:()=>Ce,isArray:()=>xt,isArrayLike:()=>Qe,isEqual:()=>M,isFunction:()=>Je,isLength:()=>v,isNil:()=>Xe,isNotNil:()=>Ze,isNull:()=>He,isPlainObject:()=>dt,isUndefined:()=>Ye,kebabCase:()=>ot,keyBy:()=>ne,last:()=>Ue,lowerCase:()=>it,max:()=>bt,maxBy:()=>re,mean:()=>j,meanBy:()=>Fe,min:()=>gt,minBy:()=>oe,negate:()=>We,noop:()=>Oe,omit:()=>Be,omitBy:()=>Ne,once:()=>je,orderBy:()=>ie,partition:()=>ue,pick:()=>ze,pickBy:()=>Le,random:()=>w,randomInt:()=>A,range:()=>Ve,round:()=>Ie,sample:()=>fe,sampleSize:()=>ae,set:()=>F,shuffle:()=>le,snakeCase:()=>rt,startCase:()=>ut,startsWith:()=>yt,sum:()=>d,sumBy:()=>Me,tail:()=>we,take:()=>se,takeRight:()=>ce,takeRightWhile:()=>me,takeWhile:()=>pe,throttle:()=>ve,toFilled:()=>Ae,union:()=>m,unionBy:()=>P,unionWith:()=>E,uniq:()=>U,uniqBy:()=>Te,uniqWith:()=>R,unzip:()=>de,unzipWith:()=>xe,withTimeout:()=>tt,without:()=>ke,xor:()=>ye,xorBy:()=>he,xorWith:()=>be,zip:()=>O,zipObject:()=>ge,zipObjectDeep:()=>mt,zipWith:()=>Ke});function _(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,u=i+t;r[o]=e.slice(i,u)}return r}function q(e){let t=[];for(let n of e)n&&t.push(n);return t}function $(e,t){var r;let n={};for(let o of e){let i=t(o);n[i]=((r=n[i])!=null?r:0)+1}return n}function y(e,t){let n=new Set(t);return e.filter(r=>!n.has(r))}function h(e,t,n){let r=new Set(t.map(o=>n(o)));return e.filter(o=>!r.has(n(o)))}function b(e,t,n){return e.filter(r=>t.every(o=>!n(r,o)))}function G(e,t){return t=Math.max(t,0),e.slice(t)}function X(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function Z(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(0,n+1);return[]}function H(e,t){let n=e.findIndex(r=>!t(r));return n===-1?[]:e.slice(n)}function Y(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),u=Math.min(r>=0?r:o+r,o);for(let f=i;f<u;f++)e[f]=t;return e}function l(e,t=1){let n=[],r=Math.floor(t),o=(i,u)=>{for(let f of i)Array.isArray(f)&&u<r?o(f,u+1):n.push(f)};return o(e,0),n}function J(e,t,n=1){return l(e.map(r=>t(r)),n)}function Q(e){return l(e,1/0)}function ee(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];t(r,n,e)}}function te(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 g(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 k(e,t,n){return e.filter(r=>t.some(o=>n(r,o)))}function ne(e,t){let n={};for(let r of e){let o=t(r);n[o]=r}return n}function re(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 oe(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 ie(e,t,n){let r=(i,u,f)=>i<u?f==="asc"?-1:1:i>u?f==="asc"?1:-1:0,o=t.map((i,u)=>n[u]||n[n.length-1]);return e.slice().sort((i,u)=>{for(let f=0;f<t.length;f++){let a=t[f],c=o[f],B=r(i[a],u[a],c);if(B!==0)return B}return 0})}function ue(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return[n,r]}function fe(e){let t=Math.floor(Math.random()*e.length);return e[t]}function w(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 A(e,t){return Math.floor(w(e,t))}function ae(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 u=A(0,o+1);r.has(u)&&(u=o),r.add(u),n[i]=e[u]}return n}function le(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 se(e,t){return e.slice(0,t)}function ce(e,t=1){return t<=0?[]:e.slice(-t)}function me(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(n+1);return e.slice()}function pe(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 m(e,t){return U(e.concat(t))}function P(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 R(e,t){let n=[];for(let r of e)n.every(i=>!t(i,r))&&n.push(r);return n}function E(e,t,n){return R(e.concat(t),n)}function Te(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 de(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 xe(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 u=0;u<e.length;u++)i[u]=e[u][o];r[o]=t(...i)}return r}function ye(e,t){return y(m(e,t),g(e,t))}function he(e,t,n){let r=P(e,t,n),o=K(e,t,n);return h(r,o,n)}function be(e,t,n){let r=E(e,t,n),o=k(e,t,n);return b(r,o,n)}function O(...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 ge(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=t[r];return n}function Ke(e,...t){let n=[e,...t.slice(0,-1)],r=t[t.length-1],o=[],i=Math.max(...n.map(u=>u.length));for(let u=0;u<i;u++){let f=n.map(a=>a[u]);o.push(r(...f))}return o}function ke(e,...t){let n=new Set(t);return e.filter(r=>!n.has(r))}function I(e){return e[0]}function we(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 Ae(e,t,n=0,r=e.length){let o=e.length,i=Math.max(n>=0?n:o+n,0),u=Math.min(r>=0?r:o+r,o),f=e.slice();for(let a=i;a<u;a++)f[a]=t;return f}function Ue(e){return e[e.length-1]}function Pe(e){return e.length<=1?[]:e.slice(0,-1)}var p=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var T=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};var Re=(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 Ee(e,t,{signal:n}={}){let r=null,o=function(...u){r!==null&&clearTimeout(r),!(n!=null&&n.aborted)&&(r=setTimeout(()=>{e(...u),r=null},t))},i=function(){o.cancel()};return o.cancel=function(){r!==null&&(clearTimeout(r),r=null)},n==null||n.addEventListener("abort",i,{once:!0}),o}function Oe(){}function je(e){let t=!1,n;return function(){if(t)return n;let r=e();return t=!0,n=r,r}}function ve(e,t){let n;return function(...o){let i=Date.now();(n==null||i-n>=t)&&(n=i,e(...o))}}function We(e){return(...t)=>!e(...t)}function De(e,t,n){return n==null?Math.min(e,t):Math.min(Math.max(e,t),n)}function Se(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 d(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function j(e){return d(e)/e.length}function Fe(e,t){let n=e.map(r=>t(r));return j(n)}function Ie(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 d(n)}function Ve(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 Be(e,t){let n=C({},e);for(let r of t)delete n[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 ze(e,t){let n={};for(let r of t)n[r]=e[r];return n}function Le(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 _e(e){if(At(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 At(e){return e==null||typeof e!="object"&&typeof e!="function"}function qe(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 Ge(e)}function Ge(e,t=""){let n={},r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],u=e[i],f=t?`${t}.${i}`:i;if(qe(u)&&Object.keys(u).length>0){Object.assign(n,Ge(u,f));continue}if(Array.isArray(u)){for(let a=0;a<u.length;a++)n[`${f}.${a}`]=u[a];continue}n[f]=u}return n}function M(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||m(n,r).length!==n.length)return!1;for(let o=0;o<n.length;o++){let i=n[o],u=e[i],f=t[i];if(!M(u,f))return!1}return!0}function Xe(e){return e==null}function Ze(e){return e!=null}function He(e){return e===null}function Ye(e){return e===void 0}function v(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function Je(e){return typeof e=="function"}function Qe(e){return e!=null&&typeof e!="function"&&v(e.length)}function W(e,{signal:t}={}){return new Promise((n,r)=>{let o=()=>{r(new p)},i=()=>{clearTimeout(u),o()};if(t!=null&&t.aborted)return o();let u=setTimeout(n,e);t==null||t.addEventListener("abort",i,{once:!0})})}function et(e){return x(this,null,function*(){throw yield W(e),new T})}function tt(e,t){return x(this,null,function*(){return Promise.race([e(),et(t)])})}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var Ut=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function s(e){var t;return Array.from((t=e.match(Ut))!=null?t:[])}function nt(e){let t=s(e);if(t.length===0)return"";let[n,...r]=t;return`${n.toLowerCase()}${r.map(o=>D(o)).join("")}`}var rt=e=>s(e).map(n=>n.toLowerCase()).join("_");var ot=e=>s(e).map(n=>n.toLowerCase()).join("-");var it=e=>s(e).map(n=>n.toLowerCase()).join(" ");function ut(e){let t=s(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 ft(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:_(e,t)}function at(...e){return l(e)}function lt(e,...t){let n=e,r=l(t);return y(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),Y(e,t,n,r)}var Pt=/^(?:0|[1-9]\d*)$/;function ct(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return Pt.test(e)}}function S(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 u=o[0],f=o[1],a=o[2],c=o[3];a?u=c.replace(t,"$1"):f&&(u=f),r.push(u),n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}function F(e,t,n){let r=Array.isArray(t)?t:typeof t=="string"?S(t):[t],o=e;for(let u=0;u<r.length-1;u++){let f=r[u],a=r[u+1];o[f]==null&&(o[f]=ct(a)?[]:{}),o=o[f]}let i=r[r.length-1];return o[i]=n,e}function mt(e,t){let n={},r=O(e,t);for(let o=0;o<r.length;o++){let[i,u]=r[o];i!=null&&F(n,i,u)}return n}var Rt=/^\w*$/,Et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function pt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!Rt.test(e)&&Et.test(e)}}function Tt(e,t,n){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&pt(t)&&(e==null?void 0:e[t])==null?r=S(t):r=[t],r.length===0)return n;let o=e,i;for(i=0;i<r.length&&o!=null;i++){let u=r[i];Object.is(u.valueOf(),-0)&&(u="-0"),o=o[u]}return o===null&&i===r.length||o!=null?o:n}function dt(e){var n;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let r=e[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&n.writable)?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function xt(e){return Array.isArray(e)}var yt=(e,t,n=0)=>e.startsWith(t,n);var ht=(e,t,n=e.length)=>e.endsWith(t,n);function bt(e=[]){let t=e[0],n;for(let r of e)(n==null||r>n)&&(n=r,t=r);return t}function gt(e=[]){let t=e[0],n;for(let r of e)(n==null||r<n)&&(n=r,t=r);return t}window._=V;})();
1
+ "use strict";(()=>{var q=Object.defineProperty;var L=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;var _=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Ut.call(t,n)&&_(e,n,t[n]);if(L)for(var n of L(t))Rt.call(t,n)&&_(e,n,t[n]);return e};var vt=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})};var h=(e,t,n)=>new Promise((r,o)=>{var i=f=>{try{u(n.next(f))}catch(c){o(c)}},a=f=>{try{u(n.throw(f))}catch(c){o(c)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(i,a);u((n=n.apply(e,t)).next())});var C={};vt(C,{AbortError:()=>m,TimeoutError:()=>y,after:()=>Ie,camelCase:()=>it,capitalize:()=>B,chunk:()=>lt,clamp:()=>Be,clone:()=>Ge,cloneDeep:()=>T,compact:()=>X,concat:()=>ct,countBy:()=>j,debounce:()=>Oe,delay:()=>M,difference:()=>Tt,differenceBy:()=>b,differenceWith:()=>K,drop:()=>Y,dropRight:()=>H,dropRightWhile:()=>Z,dropWhile:()=>J,endsWith:()=>At,fill:()=>pt,first:()=>V,flatMap:()=>ee,flatten:()=>s,flattenDeep:()=>te,flattenObject:()=>je,forEachRight:()=>ne,get:()=>xt,groupBy:()=>re,head:()=>V,inRange:()=>We,initial:()=>Pe,intersection:()=>A,intersectionBy:()=>k,intersectionWith:()=>w,invert:()=>$e,isArray:()=>gt,isArrayLike:()=>tt,isEqual:()=>N,isFunction:()=>et,isLength:()=>D,isNil:()=>He,isNotNil:()=>Ze,isNull:()=>Je,isPlainObject:()=>ht,isTypedArray:()=>bt,isUndefined:()=>Qe,kebabCase:()=>ut,keyBy:()=>oe,last:()=>ve,lowerCase:()=>ft,max:()=>kt,maxBy:()=>ie,mean:()=>F,meanBy:()=>Se,min:()=>wt,minBy:()=>ae,negate:()=>Me,noop:()=>Ee,omit:()=>ze,omitBy:()=>Le,once:()=>Fe,orderBy:()=>ue,partition:()=>fe,pick:()=>_e,pickBy:()=>qe,random:()=>U,randomInt:()=>R,range:()=>Ce,round:()=>Ve,sample:()=>se,sampleSize:()=>le,set:()=>S,shuffle:()=>ce,snakeCase:()=>at,startCase:()=>st,startsWith:()=>Kt,sum:()=>d,sumBy:()=>Ne,tail:()=>Ue,take:()=>Te,takeRight:()=>pe,takeRightWhile:()=>me,takeWhile:()=>ye,throttle:()=>De,toFilled:()=>Re,union:()=>p,unionBy:()=>P,unionWith:()=>O,uniq:()=>v,uniqBy:()=>de,uniqWith:()=>I,unzip:()=>xe,unzipWith:()=>he,withTimeout:()=>ot,without:()=>we,xor:()=>ge,xorBy:()=>be,xorWith:()=>Ke,zip:()=>E,zipObject:()=>Ae,zipObjectDeep:()=>yt,zipWith:()=>ke});function G(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 X(e){let t=[];for(let n of e)n&&t.push(n);return t}function j(e,t){var r;let n={};for(let o of e){let i=t(o);n[i]=((r=n[i])!=null?r:0)+1}return n}function g(e,t){let n=new Set(t);return e.filter(r=>!n.has(r))}function b(e,t,n){let r=new Set(t.map(o=>n(o)));return e.filter(o=>!r.has(n(o)))}function K(e,t,n){return e.filter(r=>t.every(o=>!n(r,o)))}function Y(e,t){return t=Math.max(t,0),e.slice(t)}function H(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function Z(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 Q(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 ee(e,t,n=1){return s(e.map(r=>t(r)),n)}function te(e){return s(e,1/0)}function ne(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];t(r,n,e)}}function re(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 A(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 w(e,t,n){return e.filter(r=>t.some(o=>n(r,o)))}function oe(e,t){let n={};for(let r of e){let o=t(r);n[o]=r}return n}function ie(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 ae(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 ue(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],c=o[u],z=r(i[f],a[f],c);if(z!==0)return z}return 0})}function fe(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return[n,r]}function se(e){let t=Math.floor(Math.random()*e.length);return e[t]}function U(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 R(e,t){return Math.floor(U(e,t))}function le(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=R(0,o+1);r.has(a)&&(a=o),r.add(a),n[i]=e[a]}return n}function ce(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 Te(e,t){return e.slice(0,t)}function pe(e,t=1){return t<=0?[]:e.slice(-t)}function me(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n]))return e.slice(n+1);return e.slice()}function ye(e,t){let n=[];for(let r of e){if(!t(r))break;n.push(r)}return n}function v(e){return Array.from(new Set(e))}function p(e,t){return v(e.concat(t))}function P(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 I(e,t){let n=[];for(let r of e)n.every(i=>!t(i,r))&&n.push(r);return n}function O(e,t,n){return I(e.concat(t),n)}function de(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 xe(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 he(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 ge(e,t){return g(p(e,t),A(e,t))}function be(e,t,n){let r=P(e,t,n),o=k(e,t,n);return b(r,o,n)}function Ke(e,t,n){let r=O(e,t,n),o=w(e,t,n);return K(r,o,n)}function E(...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 Ae(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=t[r];return n}function ke(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 we(e,...t){let n=new Set(t);return e.filter(r=>!n.has(r))}function V(e){return e[0]}function Ue(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 Re(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 ve(e){return e[e.length-1]}function Pe(e){return e.length<=1?[]:e.slice(0,-1)}var m=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var y=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};var Ie=(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 Oe(e,t,{signal:n}={}){let r=null,o=function(...a){r!==null&&clearTimeout(r),!(n!=null&&n.aborted)&&(r=setTimeout(()=>{e(...a),r=null},t))},i=function(){o.cancel()};return o.cancel=function(){r!==null&&(clearTimeout(r),r=null)},n==null||n.addEventListener("abort",i,{once:!0}),o}function Ee(){}function Fe(e){let t=!1,n;return function(){if(t)return n;let r=e();return t=!0,n=r,r}}function De(e,t){let n;return function(...o){let i=Date.now();(n==null||i-n>=t)&&(n=i,e(...o))}}function Me(e){return(...t)=>!e(...t)}function Be(e,t,n){return n==null?Math.min(e,t):Math.min(Math.max(e,t),n)}function We(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 d(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function F(e){return d(e)/e.length}function Se(e,t){let n=e.map(r=>t(r));return F(n)}function Ve(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 Ne(e,t){let n=e.map(r=>t(r));return d(n)}function Ce(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 ze(e,t){let n=$({},e);for(let r of t)delete n[r];return n}function Le(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)||(n[r]=o);return n}function _e(e,t){let n={};for(let r of t)n[r]=e[r];return n}function qe(e,t){let n={};for(let[r,o]of Object.entries(e))t(o,r)&&(n[r]=o);return n}function $e(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 Ge(e){if(Pt(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 Pt(e){return e==null||typeof e!="object"&&typeof e!="function"}function T(e){if(It(e))return e;if(Array.isArray(e))return e.map(t=>T(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,T(r));return t}if(e instanceof Set){let t=new Set;for(let n of e.values())t.add(T(n));return t}if(Ot(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);for(let n=0;n<e.length;n++)t[n]=T(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 x(e,t),t}if(typeof File!="undefined"&&e instanceof File){let t=new File([e],e.name,{type:e.type});return x(e,t),t}if(e instanceof Blob){let t=new Blob([e],{type:e.type});return x(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,x(e,t),t}if(typeof e=="object"&&e!==null){let t={};return x(e,t),t}if(typeof e!="function")return e}function It(e){return e==null||typeof e!="object"&&typeof e!="function"}function x(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=Object.getOwnPropertyDescriptor(e,n);(r!=null&&r.writable||r!=null&&r.set)&&typeof(r==null?void 0:r.value)!="function"&&(t[n]=T(e[n]))}}function Ot(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 Xe(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 je(e){return Ye(e)}function Ye(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(Xe(a)&&Object.keys(a).length>0){Object.assign(n,Ye(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 N(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(!N(a,u))return!1}return!0}function He(e){return e==null}function Ze(e){return e!=null}function Je(e){return e===null}function Qe(e){return e===void 0}function D(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function et(e){return typeof e=="function"}function tt(e){return e!=null&&typeof e!="function"&&D(e.length)}function nt(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 M(e,{signal:t}={}){return new Promise((n,r)=>{let o=()=>{r(new m)},i=()=>{clearTimeout(a),o()};if(t!=null&&t.aborted)return o();let a=setTimeout(n,e);t==null||t.addEventListener("abort",i,{once:!0})})}function rt(e){return h(this,null,function*(){throw yield M(e),new y})}function ot(e,t){return h(this,null,function*(){return Promise.race([e(),rt(t)])})}var B=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var Et=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){var t;return Array.from((t=e.match(Et))!=null?t:[])}function it(e){let t=l(e);if(t.length===0)return"";let[n,...r]=t;return`${n.toLowerCase()}${r.map(o=>B(o)).join("")}`}var at=e=>l(e).map(n=>n.toLowerCase()).join("_");var ut=e=>l(e).map(n=>n.toLowerCase()).join("-");var ft=e=>l(e).map(n=>n.toLowerCase()).join(" ");function st(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 lt(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:G(e,t)}function ct(...e){return s(e)}function Tt(e,...t){let n=e,r=s(t);return g(n,r)}function pt(e,t,n=0,r=e.length){return n=Math.floor(n),r=Math.floor(r),n||(n=0),r||(r=0),Q(e,t,n,r)}var Ft=/^(?:0|[1-9]\d*)$/;function mt(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return Ft.test(e)}}function W(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],c=o[3];f?a=c.replace(t,"$1"):u&&(a=u),r.push(a),n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}function S(e,t,n){let r=Array.isArray(t)?t:typeof t=="string"?W(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]=mt(f)?[]:{}),o=o[u]}let i=r[r.length-1];return o[i]=n,e}function yt(e,t){let n={},r=E(e,t);for(let o=0;o<r.length;o++){let[i,a]=r[o];i!=null&&S(n,i,a)}return n}var Dt=/^\w*$/,Mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function dt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!Dt.test(e)&&Mt.test(e)}}function xt(e,t,n){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&dt(t)&&(e==null?void 0:e[t])==null?r=W(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!=null?o:n}function ht(e){var n;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let r=e[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&n.writable)?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function gt(e){return Array.isArray(e)}function bt(e){return nt(e)}var Kt=(e,t,n=0)=>e.startsWith(t,n);var At=(e,t,n=e.length)=>e.endsWith(t,n);function kt(e=[]){let t=e[0],n;for(let r of e)(n==null||r>n)&&(n=r,t=r);return t}function wt(e=[]){let t=e[0],n;for(let r of e)(n==null||r<n)&&(n=r,t=r);return t}window._=C;})();
2
2
  //# sourceMappingURL=browser.global.js.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-54TK5BIS.mjs.map