es-toolkit 1.13.1-dev.317 → 1.13.1-dev.318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/index.mjs +16 -16
- package/dist/browser.js +90 -0
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +25 -24
- package/dist/browser.mjs.map +1 -1
- package/dist/{chunk-HKO7DEJK.mjs → chunk-36ZJSTNA.mjs} +54 -50
- package/dist/{chunk-HKO7DEJK.mjs.map → chunk-36ZJSTNA.mjs.map} +1 -1
- package/dist/chunk-5CPXZFCB.mjs +93 -0
- package/dist/chunk-5CPXZFCB.mjs.map +1 -0
- package/dist/chunk-YXAOYIRV.mjs +1 -0
- package/dist/compat/index.d.mts +1 -0
- package/dist/compat/index.d.ts +1 -0
- package/dist/compat/index.js +91 -0
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +56 -52
- package/dist/function/index.mjs +9 -9
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -53
- package/dist/object/cloneDeep.d.mts +64 -0
- package/dist/object/cloneDeep.d.ts +64 -0
- package/dist/object/cloneDeep.js +117 -0
- package/dist/object/cloneDeep.js.map +1 -0
- package/dist/object/cloneDeep.mjs +8 -0
- package/dist/object/cloneDeep.mjs.map +1 -0
- package/dist/object/index.d.mts +1 -0
- package/dist/object/index.d.ts +1 -0
- package/dist/object/index.js +91 -0
- package/dist/object/index.js.map +1 -1
- package/dist/object/index.mjs +8 -4
- package/dist/predicate/index.mjs +3 -3
- package/dist/string/index.mjs +3 -3
- package/package.json +1 -1
- package/umd/browser.global.js +1 -1
- package/dist/chunk-54TK5BIS.mjs +0 -1
- /package/dist/{chunk-54TK5BIS.mjs.map → chunk-YXAOYIRV.mjs.map} +0 -0
package/dist/object/index.js.map
CHANGED
|
@@ -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;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;ACjBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB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AAEA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,MAAM,MAAM,MAAM;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,SAAS,MAAM,mBAAmB;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ;AAEZ,SAAO,OAAO,eAAe,KAAK,MAAM,MAAM;AAC5C,YAAQ,OAAO,eAAe,KAAK;AAAA,EACrC;AAEA,SAAO,OAAO,eAAe,MAAM,MAAM;AAC3C;;;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":[]}
|
|
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[`${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;AAAA;;;ACiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;ACjBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QA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AAM,KAAK;AAAA,MACjD;AACA;AAAA,IACF;AAEA,WAAO,WAAW,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;","names":["isPrimitive"]}
|
package/dist/object/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import "../chunk-
|
|
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,
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "../chunk-U4JWMVQK.mjs";
|
|
2
|
+
import {
|
|
3
|
+
isFunction
|
|
4
|
+
} from "../chunk-74CREQXW.mjs";
|
|
2
5
|
import {
|
|
3
6
|
isNil
|
|
4
7
|
} from "../chunk-WMM7TZLG.mjs";
|
|
@@ -20,9 +23,6 @@ import {
|
|
|
20
23
|
import {
|
|
21
24
|
isEqual
|
|
22
25
|
} from "../chunk-JYSV56US.mjs";
|
|
23
|
-
import {
|
|
24
|
-
isFunction
|
|
25
|
-
} from "../chunk-74CREQXW.mjs";
|
|
26
26
|
import {
|
|
27
27
|
isPlainObject
|
|
28
28
|
} from "../chunk-MIGAC7F4.mjs";
|
package/dist/string/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "../chunk-XT74R35S.mjs";
|
|
2
|
+
import {
|
|
3
|
+
snakeCase
|
|
4
|
+
} from "../chunk-F3WCQQET.mjs";
|
|
2
5
|
import {
|
|
3
6
|
startCase
|
|
4
7
|
} from "../chunk-QXTNZR7B.mjs";
|
|
@@ -14,9 +17,6 @@ import {
|
|
|
14
17
|
import {
|
|
15
18
|
lowerCase
|
|
16
19
|
} 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.
|
|
4
|
+
"version": "1.13.1-dev.318+b08e5c9b",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|
package/umd/browser.global.js
CHANGED
|
@@ -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 kt=Object.prototype.hasOwnProperty,wt=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={}))kt.call(t,n)&&_(e,n,t[n]);if(L)for(var n of L(t))wt.call(t,n)&&_(e,n,t[n]);return e};var Rt=(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 z={};Rt(z,{AbortError:()=>m,TimeoutError:()=>d,after:()=>Oe,camelCase:()=>ot,capitalize:()=>W,chunk:()=>st,clamp:()=>We,clone:()=>Ge,cloneDeep:()=>T,compact:()=>X,concat:()=>lt,countBy:()=>j,debounce:()=>Ie,delay:()=>M,difference:()=>ct,differenceBy:()=>b,differenceWith:()=>K,drop:()=>Y,dropRight:()=>H,dropRightWhile:()=>Z,dropWhile:()=>J,endsWith:()=>bt,fill:()=>Tt,first:()=>B,flatMap:()=>ee,flatten:()=>s,flattenDeep:()=>te,flattenObject:()=>je,forEachRight:()=>ne,get:()=>yt,groupBy:()=>re,head:()=>B,inRange:()=>Se,initial:()=>Pe,intersection:()=>A,intersectionBy:()=>k,intersectionWith:()=>w,invert:()=>$e,isArray:()=>ht,isArrayLike:()=>tt,isEqual:()=>N,isFunction:()=>et,isLength:()=>D,isNil:()=>He,isNotNil:()=>Ze,isNull:()=>Je,isPlainObject:()=>xt,isUndefined:()=>Qe,kebabCase:()=>at,keyBy:()=>oe,last:()=>ve,lowerCase:()=>ut,max:()=>Kt,maxBy:()=>ie,mean:()=>F,meanBy:()=>Ve,min:()=>At,minBy:()=>ae,negate:()=>Me,noop:()=>Ee,omit:()=>Ce,omitBy:()=>Le,once:()=>Fe,orderBy:()=>ue,partition:()=>fe,pick:()=>_e,pickBy:()=>qe,random:()=>R,randomInt:()=>U,range:()=>ze,round:()=>Be,sample:()=>se,sampleSize:()=>le,set:()=>V,shuffle:()=>ce,snakeCase:()=>it,startCase:()=>ft,startsWith:()=>gt,sum:()=>y,sumBy:()=>Ne,tail:()=>Re,take:()=>Te,takeRight:()=>pe,takeRightWhile:()=>me,takeWhile:()=>de,throttle:()=>De,toFilled:()=>Ue,union:()=>p,unionBy:()=>P,unionWith:()=>I,uniq:()=>v,uniqBy:()=>ye,uniqWith:()=>O,unzip:()=>xe,unzipWith:()=>he,withTimeout:()=>rt,without:()=>we,xor:()=>ge,xorBy:()=>be,xorWith:()=>Ke,zip:()=>E,zipObject:()=>Ae,zipObjectDeep:()=>mt,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],C=r(i[f],a[f],c);if(C!==0)return C}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 R(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 U(e,t){return Math.floor(R(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=U(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 de(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 O(e,t){let n=[];for(let r of e)n.every(i=>!t(i,r))&&n.push(r);return n}function I(e,t,n){return O(e.concat(t),n)}function ye(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=I(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 B(e){return e[0]}function Re(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 Ue(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 d=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};var Oe=(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 Ie(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 We(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 y(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function F(e){return y(e)/e.length}function Ve(e,t){let n=e.map(r=>t(r));return F(n)}function Be(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 y(n)}function ze(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 Ce(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(Ut(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 Ut(e){return e==null||typeof e!="object"&&typeof e!="function"}function T(e){if(vt(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(Pt(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 vt(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 Pt(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 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 nt(e){return h(this,null,function*(){throw yield M(e),new d})}function rt(e,t){return h(this,null,function*(){return Promise.race([e(),nt(t)])})}var W=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var Ot=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){var t;return Array.from((t=e.match(Ot))!=null?t:[])}function ot(e){let t=l(e);if(t.length===0)return"";let[n,...r]=t;return`${n.toLowerCase()}${r.map(o=>W(o)).join("")}`}var it=e=>l(e).map(n=>n.toLowerCase()).join("_");var at=e=>l(e).map(n=>n.toLowerCase()).join("-");var ut=e=>l(e).map(n=>n.toLowerCase()).join(" ");function ft(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 st(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:G(e,t)}function lt(...e){return s(e)}function ct(e,...t){let n=e,r=s(t);return g(n,r)}function Tt(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 It=/^(?:0|[1-9]\d*)$/;function pt(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return It.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 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 V(e,t,n){let r=Array.isArray(t)?t:typeof t=="string"?S(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]=pt(f)?[]:{}),o=o[u]}let i=r[r.length-1];return o[i]=n,e}function mt(e,t){let n={},r=E(e,t);for(let o=0;o<r.length;o++){let[i,a]=r[o];i!=null&&V(n,i,a)}return n}var Et=/^\w*$/,Ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function dt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!Et.test(e)&&Ft.test(e)}}function yt(e,t,n){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&dt(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 a=r[i];Object.is(a.valueOf(),-0)&&(a="-0"),o=o[a]}return o===null&&i===r.length||o!=null?o:n}function xt(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 ht(e){return Array.isArray(e)}var gt=(e,t,n=0)=>e.startsWith(t,n);var bt=(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 At(e=[]){let t=e[0],n;for(let r of e)(n==null||r<n)&&(n=r,t=r);return t}window._=z;})();
|
|
2
2
|
//# sourceMappingURL=browser.global.js.map
|
package/dist/chunk-54TK5BIS.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-54TK5BIS.mjs.map
|
|
File without changes
|