es-toolkit 1.12.0-dev.287 → 1.12.0-dev.288

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 (39) hide show
  1. package/dist/browser.js +6 -0
  2. package/dist/browser.js.map +1 -1
  3. package/dist/browser.mjs +6 -5
  4. package/dist/browser.mjs.map +1 -1
  5. package/dist/chunk-27QMXBLJ.mjs +9 -0
  6. package/dist/chunk-27QMXBLJ.mjs.map +1 -0
  7. package/dist/chunk-B645AYL4.mjs +1 -0
  8. package/dist/{chunk-GP2O5UBG.mjs → chunk-UTBNEZQX.mjs} +9 -5
  9. package/dist/{chunk-GP2O5UBG.mjs.map → chunk-UTBNEZQX.mjs.map} +1 -1
  10. package/dist/{chunk-32AEPQYI.mjs → chunk-Y5V7UAZZ.mjs} +4 -4
  11. package/dist/compat/index.d.mts +1 -0
  12. package/dist/compat/index.d.ts +1 -0
  13. package/dist/compat/index.js +7 -0
  14. package/dist/compat/index.js.map +1 -1
  15. package/dist/compat/index.mjs +11 -7
  16. package/dist/compat/index.mjs.map +1 -1
  17. package/dist/index.d.mts +1 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +7 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +11 -7
  22. package/dist/predicate/index.d.mts +1 -0
  23. package/dist/predicate/index.d.ts +1 -0
  24. package/dist/predicate/index.js +7 -0
  25. package/dist/predicate/index.js.map +1 -1
  26. package/dist/predicate/index.mjs +8 -4
  27. package/dist/predicate/isLength.d.mts +3 -0
  28. package/dist/predicate/isLength.d.ts +3 -0
  29. package/dist/predicate/isLength.js +33 -0
  30. package/dist/predicate/isLength.js.map +1 -0
  31. package/dist/predicate/isLength.mjs +8 -0
  32. package/dist/predicate/isLength.mjs.map +1 -0
  33. package/dist/string/camelCase.mjs +2 -2
  34. package/dist/string/index.mjs +2 -2
  35. package/package.json +1 -1
  36. package/umd/browser.global.js +1 -1
  37. package/dist/chunk-WGX4WINP.mjs +0 -1
  38. /package/dist/{chunk-WGX4WINP.mjs.map → chunk-B645AYL4.mjs.map} +0 -0
  39. /package/dist/{chunk-32AEPQYI.mjs.map → chunk-Y5V7UAZZ.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-GP2O5UBG.mjs";
1
+ import "./chunk-UTBNEZQX.mjs";
2
2
  import "./chunk-XT74R35S.mjs";
3
3
  import {
4
4
  kebabCase
@@ -22,27 +22,30 @@ import {
22
22
  } from "./chunk-O64NE2P4.mjs";
23
23
  import {
24
24
  camelCase
25
- } from "./chunk-32AEPQYI.mjs";
26
- import "./chunk-WVQ7YVRK.mjs";
25
+ } from "./chunk-Y5V7UAZZ.mjs";
27
26
  import {
28
27
  capitalize
29
28
  } from "./chunk-U56ZOM7L.mjs";
30
- import "./chunk-WGX4WINP.mjs";
29
+ import "./chunk-WVQ7YVRK.mjs";
30
+ import "./chunk-B645AYL4.mjs";
31
+ import {
32
+ isNull
33
+ } from "./chunk-AIRSKN47.mjs";
31
34
  import {
32
35
  isUndefined
33
36
  } from "./chunk-VH2PV426.mjs";
34
37
  import {
35
38
  isEqual
36
39
  } from "./chunk-JYSV56US.mjs";
40
+ import {
41
+ isLength
42
+ } from "./chunk-27QMXBLJ.mjs";
37
43
  import {
38
44
  isNil
39
45
  } from "./chunk-WMM7TZLG.mjs";
40
46
  import {
41
47
  isNotNil
42
48
  } from "./chunk-BMRTZMRE.mjs";
43
- import {
44
- isNull
45
- } from "./chunk-AIRSKN47.mjs";
46
49
  import "./chunk-54TK5BIS.mjs";
47
50
  import {
48
51
  omitBy
@@ -311,6 +314,7 @@ export {
311
314
  intersectionWith,
312
315
  invert,
313
316
  isEqual,
317
+ isLength,
314
318
  isNil,
315
319
  isNotNil,
316
320
  isNull,
@@ -3,4 +3,5 @@ export { isNil } from './isNil.mjs';
3
3
  export { isNotNil } from './isNotNil.mjs';
4
4
  export { isNull } from './isNull.mjs';
5
5
  export { isUndefined } from './isUndefined.mjs';
6
+ export { isLength } from './isLength.mjs';
6
7
  export { isPlainObject } from './isPlainObject.mjs';
@@ -3,4 +3,5 @@ export { isNil } from './isNil.js';
3
3
  export { isNotNil } from './isNotNil.js';
4
4
  export { isNull } from './isNull.js';
5
5
  export { isUndefined } from './isUndefined.js';
6
+ export { isLength } from './isLength.js';
6
7
  export { isPlainObject } from './isPlainObject.js';
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var predicate_exports = {};
22
22
  __export(predicate_exports, {
23
23
  isEqual: () => isEqual,
24
+ isLength: () => isLength,
24
25
  isNil: () => isNil,
25
26
  isNotNil: () => isNotNil,
26
27
  isNull: () => isNull,
@@ -92,6 +93,11 @@ function isUndefined(x) {
92
93
  return x === void 0;
93
94
  }
94
95
 
96
+ // src/predicate/isLength.ts
97
+ function isLength(value) {
98
+ return typeof value === "number" && value > -1 && value % 1 === 0 && value <= Number.MAX_SAFE_INTEGER;
99
+ }
100
+
95
101
  // src/predicate/isPlainObject.ts
96
102
  function isPlainObject(object) {
97
103
  if (typeof object !== "object") {
@@ -115,6 +121,7 @@ function isPlainObject(object) {
115
121
  // Annotate the CommonJS export names for ESM import in node:
116
122
  0 && (module.exports = {
117
123
  isEqual,
124
+ isLength,
118
125
  isNil,
119
126
  isNotNil,
120
127
  isNull,
@@ -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/isPlainObject.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 { isPlainObject } from './isPlainObject.ts';","/**\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","/**\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}"],"mappings":";;;;;;;;;;;;;;;;;;;;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;AAAA,EACT;AAEA,QAAM,QAAQ,OAAO,KAAK,CAAW;AACrC,QAAM,QAAQ,OAAO,KAAK,CAAW;AAErC,MAAI,MAAM,WAAW,MAAM,QAAQ;AACjC,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,OAAO,KAAK,EAAE,WAAW,MAAM,QAAQ;AAC/C,WAAO;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,UAAU,MAAM,CAAC;AACvB,UAAM,QAAS,EAAU,OAAO;AAChC,UAAM,QAAS,EAAU,OAAO;AAEhC,QAAI,CAAC,QAAQ,OAAO,KAAK,GAAG;AAC1B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;;;ACrCO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK;AACd;;;ACLO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACEO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;;;ACTO,SAAS,cAAc,QAAyB;AACrD,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,MAAM,MAAM,MAAM;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,SAAS,MAAM,mBAAmB;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ;AAEZ,SAAO,OAAO,eAAe,KAAK,MAAM,MAAM;AAC5C,YAAQ,OAAO,eAAe,KAAK;AAAA,EACrC;AAEA,SAAO,OAAO,eAAe,MAAM,MAAM;AAC3C;","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"],"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';\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}"],"mappings":";;;;;;;;;;;;;;;;;;;;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;AAAA,EACT;AAEA,QAAM,QAAQ,OAAO,KAAK,CAAW;AACrC,QAAM,QAAQ,OAAO,KAAK,CAAW;AAErC,MAAI,MAAM,WAAW,MAAM,QAAQ;AACjC,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,OAAO,KAAK,EAAE,WAAW,MAAM,QAAQ;AAC/C,WAAO;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,UAAU,MAAM,CAAC;AACvB,UAAM,QAAS,EAAU,OAAO;AAChC,UAAM,QAAS,EAAU,OAAO;AAEhC,QAAI,CAAC,QAAQ,OAAO,KAAK,GAAG;AAC1B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;;;ACrCO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK;AACd;;;ACLO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACEO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;;;ACtBO,SAAS,SAAS,OAAiC;AACxD,SAAO,OAAO,UAAU,YAAY,QAAQ,MAAM,QAAQ,MAAM,KAAK,SAAS,OAAO;AACvF;;;ACWO,SAAS,cAAc,QAAyB;AACrD,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,MAAM,MAAM,MAAM;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,SAAS,MAAM,mBAAmB;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ;AAEZ,SAAO,OAAO,eAAe,KAAK,MAAM,MAAM;AAC5C,YAAQ,OAAO,eAAe,KAAK;AAAA,EACrC;AAEA,SAAO,OAAO,eAAe,MAAM,MAAM;AAC3C;","names":[]}
@@ -1,19 +1,22 @@
1
- import "../chunk-WGX4WINP.mjs";
1
+ import "../chunk-B645AYL4.mjs";
2
+ import {
3
+ isNull
4
+ } from "../chunk-AIRSKN47.mjs";
2
5
  import {
3
6
  isUndefined
4
7
  } from "../chunk-VH2PV426.mjs";
5
8
  import {
6
9
  isEqual
7
10
  } from "../chunk-JYSV56US.mjs";
11
+ import {
12
+ isLength
13
+ } from "../chunk-27QMXBLJ.mjs";
8
14
  import {
9
15
  isNil
10
16
  } from "../chunk-WMM7TZLG.mjs";
11
17
  import {
12
18
  isNotNil
13
19
  } from "../chunk-BMRTZMRE.mjs";
14
- import {
15
- isNull
16
- } from "../chunk-AIRSKN47.mjs";
17
20
  import {
18
21
  isPlainObject
19
22
  } from "../chunk-MIGAC7F4.mjs";
@@ -22,6 +25,7 @@ import "../chunk-DVK2N4KC.mjs";
22
25
  import "../chunk-24FKGR6U.mjs";
23
26
  export {
24
27
  isEqual,
28
+ isLength,
25
29
  isNil,
26
30
  isNotNil,
27
31
  isNull,
@@ -0,0 +1,3 @@
1
+ declare function isLength(value: unknown): value is number;
2
+
3
+ export { isLength };
@@ -0,0 +1,3 @@
1
+ declare function isLength(value: unknown): value is number;
2
+
3
+ export { isLength };
@@ -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/isLength.ts
21
+ var isLength_exports = {};
22
+ __export(isLength_exports, {
23
+ isLength: () => isLength
24
+ });
25
+ module.exports = __toCommonJS(isLength_exports);
26
+ function isLength(value) {
27
+ return typeof value === "number" && value > -1 && value % 1 === 0 && value <= Number.MAX_SAFE_INTEGER;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isLength
32
+ });
33
+ //# sourceMappingURL=isLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/predicate/isLength.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,SAAS,OAAiC;AACxD,SAAO,OAAO,UAAU,YAAY,QAAQ,MAAM,QAAQ,MAAM,KAAK,SAAS,OAAO;AACvF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ isLength
3
+ } from "../chunk-27QMXBLJ.mjs";
4
+ import "../chunk-24FKGR6U.mjs";
5
+ export {
6
+ isLength
7
+ };
8
+ //# sourceMappingURL=isLength.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  camelCase
3
- } from "../chunk-32AEPQYI.mjs";
4
- import "../chunk-WVQ7YVRK.mjs";
3
+ } from "../chunk-Y5V7UAZZ.mjs";
5
4
  import "../chunk-U56ZOM7L.mjs";
5
+ import "../chunk-WVQ7YVRK.mjs";
6
6
  import "../chunk-24FKGR6U.mjs";
7
7
  export {
8
8
  camelCase
@@ -13,11 +13,11 @@ import {
13
13
  } from "../chunk-QXTNZR7B.mjs";
14
14
  import {
15
15
  camelCase
16
- } from "../chunk-32AEPQYI.mjs";
17
- import "../chunk-WVQ7YVRK.mjs";
16
+ } from "../chunk-Y5V7UAZZ.mjs";
18
17
  import {
19
18
  capitalize
20
19
  } from "../chunk-U56ZOM7L.mjs";
20
+ import "../chunk-WVQ7YVRK.mjs";
21
21
  import "../chunk-24FKGR6U.mjs";
22
22
  export {
23
23
  camelCase,
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.12.0-dev.287+701e8230",
4
+ "version": "1.12.0-dev.288+caedf69a",
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 V=Object.defineProperty;var I=Object.getOwnPropertySymbols;var rr=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable;var z=(e,r,t)=>r in e?V(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,N=(e,r)=>{for(var t in r||(r={}))rr.call(r,t)&&z(e,t,r[t]);if(I)for(var t of I(r))tr.call(r,t)&&z(e,t,r[t]);return e};var nr=(e,r)=>{for(var t in r)V(e,t,{get:r[t],enumerable:!0})};var y=(e,r,t)=>new Promise((n,o)=>{var i=f=>{try{a(t.next(f))}catch(x){o(x)}},u=f=>{try{a(t.throw(f))}catch(x){o(x)}},a=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,u);a((t=t.apply(e,r)).next())});var M={};nr(M,{AbortError:()=>m,TimeoutError:()=>p,camelCase:()=>Je,capitalize:()=>B,chunk:()=>j,clamp:()=>Fe,clone:()=>De,compact:()=>D,countBy:()=>C,debounce:()=>Re,delay:()=>K,difference:()=>d,differenceBy:()=>h,differenceWith:()=>b,drop:()=>L,dropRight:()=>q,dropRightWhile:()=>_,dropWhile:()=>$,fill:()=>Z,flatMap:()=>H,flatten:()=>s,flattenDeep:()=>G,flattenObject:()=>Ce,forEachRight:()=>J,groupBy:()=>Q,head:()=>ge,inRange:()=>Ke,initial:()=>Ae,intersection:()=>g,intersectionBy:()=>w,intersectionWith:()=>U,invert:()=>je,isEqual:()=>E,isNil:()=>qe,isNotNil:()=>_e,isNull:()=>$e,isPlainObject:()=>F,isUndefined:()=>Ze,kebabCase:()=>Xe,keyBy:()=>X,last:()=>ke,lowerCase:()=>Ye,maxBy:()=>Y,mean:()=>P,meanBy:()=>Be,minBy:()=>ee,negate:()=>Pe,noop:()=>ve,omit:()=>Ie,omitBy:()=>ze,once:()=>We,orderBy:()=>re,partition:()=>te,pick:()=>Ve,pickBy:()=>Ne,random:()=>k,randomInt:()=>A,range:()=>Se,round:()=>Ee,sample:()=>ne,sampleSize:()=>oe,shuffle:()=>ie,snakeCase:()=>Qe,startCase:()=>er,sum:()=>T,sumBy:()=>Me,tail:()=>we,take:()=>ue,takeRight:()=>ae,takeRightWhile:()=>fe,takeWhile:()=>le,throttle:()=>Oe,toFilled:()=>Ue,union:()=>c,unionBy:()=>v,unionWith:()=>O,uniq:()=>R,uniqBy:()=>se,uniqWith:()=>W,unzip:()=>ce,unzipWith:()=>me,withTimeout:()=>Ge,without:()=>be,xor:()=>pe,xorBy:()=>Te,xorWith:()=>xe,zip:()=>ye,zipObject:()=>de,zipWith:()=>he});function j(e,r){if(!Number.isInteger(r)||r<=0)throw new Error("Size must be an integer greater than zero.");let t=Math.ceil(e.length/r),n=Array(t);for(let o=0;o<t;o++){let i=o*r,u=i+r;n[o]=e.slice(i,u)}return n}function D(e){let r=[];for(let t of e)t&&r.push(t);return r}function C(e,r){var n;let t={};for(let o of e){let i=r(o);t[i]=((n=t[i])!=null?n:0)+1}return t}function d(e,r){let t=new Set(r);return e.filter(n=>!t.has(n))}function h(e,r,t){let n=new Set(r.map(o=>t(o)));return e.filter(o=>!n.has(t(o)))}function b(e,r,t){return e.filter(n=>r.every(o=>!t(n,o)))}function L(e,r){return r=Math.max(r,0),e.slice(r)}function q(e,r){return r=Math.min(-r,0),r===0?e.slice():e.slice(0,r)}function _(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(0,t+1);return[]}function $(e,r){let t=e.findIndex(n=>!r(n));return t===-1?[]:e.slice(t)}function Z(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o);for(let a=i;a<u;a++)e[a]=r;return e}function s(e,r=1){let t=[],n=Math.floor(r),o=(i,u)=>{for(let a of i)Array.isArray(a)&&u<n?o(a,u+1):t.push(a)};return o(e,0),t}function H(e,r,t=1){return s(e.map(n=>r(n)),t)}function G(e){return s(e,1/0)}function J(e,r){for(let t=e.length-1;t>=0;t--){let n=e[t];r(n,t,e)}}function Q(e,r){let t={};for(let n of e){let o=r(n);t[o]==null&&(t[o]=[]),t[o].push(n)}return t}function g(e,r){let t=new Set(r);return e.filter(n=>t.has(n))}function w(e,r,t){let n=new Set(r.map(t));return e.filter(o=>n.has(t(o)))}function U(e,r,t){return e.filter(n=>r.some(o=>t(n,o)))}function X(e,r){let t={};for(let n of e){let o=r(n);t[o]=n}return t}function Y(e,r){let t=e[0],n=-1/0;for(let o of e){let i=r(o);i>n&&(n=i,t=o)}return t}function ee(e,r){let t=e[0],n=1/0;for(let o of e){let i=r(o);i<n&&(n=i,t=o)}return t}function re(e,r,t){let n=(i,u,a)=>i<u?a==="asc"?-1:1:i>u?a==="asc"?1:-1:0,o=r.map((i,u)=>t[u]||t[t.length-1]);return e.slice().sort((i,u)=>{for(let a=0;a<r.length;a++){let f=r[a],x=o[a],S=n(i[f],u[f],x);if(S!==0)return S}return 0})}function te(e,r){let t=[],n=[];for(let o of e)r(o)?t.push(o):n.push(o);return[t,n]}function ne(e){let r=Math.floor(Math.random()*e.length);return e[r]}function k(e,r){if(r==null&&(r=e,e=0),e>=r)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(r-e)+e}function A(e,r){return Math.floor(k(e,r))}function oe(e,r){if(r>e.length)throw new Error("Size must be less than or equal to the length of array.");let t=new Array(r),n=new Set;for(let o=e.length-r,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),t[i]=e[u]}return t}function ie(e){let r=e.slice();for(let t=r.length-1;t>=1;t--){let n=Math.floor(Math.random()*(t+1));[r[t],r[n]]=[r[n],r[t]]}return r}function ue(e,r){return e.slice(0,r)}function ae(e,r){return r===0?[]:e.slice(-r)}function fe(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(t+1);return e.slice()}function le(e,r){let t=[];for(let n of e){if(!r(n))break;t.push(n)}return t}function R(e){return Array.from(new Set(e))}function c(e,r){return R(e.concat(r))}function v(e,r,t){let n=new Map;for(let o of[...e,...r]){let i=t(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function W(e,r){let t=[];for(let n of e)t.every(i=>!r(i,n))&&t.push(n);return t}function O(e,r,t){return W(e.concat(r),t)}function se(e,r){let t=new Map;for(let n of e){let o=r(n);t.has(o)||t.set(o,n)}return Array.from(t.values())}function ce(e){let r=0;for(let n=0;n<e.length;n++)e[n].length>r&&(r=e[n].length);let t=new Array(r);for(let n=0;n<r;n++){t[n]=new Array(e.length);for(let o=0;o<e.length;o++)t[n][o]=e[o][n]}return t}function me(e,r){let t=Math.max(...e.map(o=>o.length)),n=new Array(t);for(let o=0;o<t;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=r(...i)}return n}function pe(e,r){return d(c(e,r),g(e,r))}function Te(e,r,t){let n=v(e,r,t),o=w(e,r,t);return h(n,o,t)}function xe(e,r,t){let n=O(e,r,t),o=U(e,r,t);return b(n,o,t)}function ye(...e){let r=[],t=Math.max(...e.map(n=>n.length));for(let n=0;n<t;n++){let o=[];for(let i of e)o.push(i[n]);r.push(o)}return r}function de(e,r){let t={};for(let n=0;n<e.length;n++)t[e[n]]=r[n];return t}function he(e,...r){let t=[e,...r.slice(0,-1)],n=r[r.length-1],o=[],i=Math.max(...t.map(u=>u.length));for(let u=0;u<i;u++){let a=t.map(f=>f[u]);o.push(n(...a))}return o}function be(e,...r){let t=new Set(r);return e.filter(n=>!t.has(n))}function ge(e){return e[0]}function we(e){let r=e.length;if(r<=1)return[];let t=new Array(r-1);for(let n=1;n<r;n++)t[n-1]=e[n];return t}function Ue(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o),a=e.slice();for(let f=i;f<u;f++)a[f]=r;return a}function ke(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var m=class extends Error{constructor(r="The operation was aborted"){super(r),this.name="AbortError"}};var p=class extends Error{constructor(r="The operation was timed out"){super(r),this.name="TimeoutError"}};function Re(e,r,{signal:t}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(t!=null&&t.aborted)&&(n=setTimeout(()=>{e(...u),n=null},r))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},t==null||t.addEventListener("abort",i,{once:!0}),o}function ve(){}function We(e){let r=!1,t;return function(){if(r)return t;let n=e();return r=!0,t=n,n}}function Oe(e,r){let t;return function(...o){let i=Date.now();(t==null||i-t>=r)&&(t=i,e(...o))}}function Pe(e){return(...r)=>!e(...r)}function Fe(e,r,t){return t==null?Math.min(e,r):Math.min(Math.max(e,r),t)}function Ke(e,r,t){if(t==null&&(t=r,r=0),r>=t)throw new Error("The maximum value must be greater than the minimum value.");return r<=e&&e<t}function T(e){let r=0;for(let t=0;t<e.length;t++)r+=e[t];return r}function P(e){return T(e)/e.length}function Be(e,r){let t=e.map(n=>r(n));return P(t)}function Ee(e,r=0){if(!Number.isInteger(r))throw new Error("Precision must be an integer.");let t=Math.pow(10,r);return Math.round(e*t)/t}function Me(e,r){let t=e.map(n=>r(n));return T(t)}function Se(e,r,t){if(r==null&&(r=e,e=0),t==null&&(t=1),!Number.isInteger(t)||t===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((r-e)/t),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*t;return o}function Ie(e,r){let t=N({},e);for(let n of r)delete t[n];return t}function ze(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)||(t[n]=o);return t}function Ve(e,r){let t={};for(let n of r)t[n]=e[n];return t}function Ne(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)&&(t[n]=o);return t}function je(e){let r={},t=Object.keys(e);for(let n=0;n<t.length;n++){let o=t[n],i=e[o];r[i]=o}return r}function De(e){if(or(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 r=new Map;for(let[t,n]of e)r.set(t,n);return r}if(e instanceof Set){let r=new Set;for(let t of e)r.add(t);return r}return typeof e=="object"?Object.assign({},e):e}function or(e){return e==null||typeof e!="object"&&typeof e!="function"}function F(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ce(e){return Le(e)}function Le(e,r=""){let t={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],a=r?`${r}.${i}`:i;if(F(u)&&Object.keys(u).length>0){Object.assign(t,Le(u,a));continue}if(Array.isArray(u)){for(let f=0;f<u.length;f++)t[`${a}.${f}`]=u[f];continue}t[a]=u}return t}function E(e,r){if(Object.is(e,r))return!0;if(e instanceof Date&&r instanceof Date)return e.getTime()===r.getTime();if(e instanceof RegExp&&r instanceof RegExp)return e.source===r.source&&e.flags===r.flags;if(typeof e!="object"||typeof r!="object"||e===null||r===null)return!1;let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length||c(t,n).length!==t.length)return!1;for(let o=0;o<t.length;o++){let i=t[o],u=e[i],a=r[i];if(!E(u,a))return!1}return!0}function qe(e){return e==null}function _e(e){return e!=null}function $e(e){return e===null}function Ze(e){return e===void 0}function K(e,{signal:r}={}){return new Promise((t,n)=>{let o=()=>{n(new m)},i=()=>{clearTimeout(u),o()};if(r!=null&&r.aborted)return o();let u=setTimeout(t,e);r==null||r.addEventListener("abort",i,{once:!0})})}function He(e){return y(this,null,function*(){throw yield K(e),new p})}function Ge(e,r){return y(this,null,function*(){return Promise.race([e(),He(r)])})}var B=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var ir=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){var r;return Array.from((r=e.match(ir))!=null?r:[])}function Je(e){let r=l(e);if(r.length===0)return"";let[t,...n]=r;return`${t.toLowerCase()}${n.map(o=>B(o)).join("")}`}var Qe=e=>l(e).map(t=>t.toLowerCase()).join("_");var Xe=e=>l(e).map(t=>t.toLowerCase()).join("-");var Ye=e=>l(e).map(t=>t.toLowerCase()).join(" ");function er(e){let r=l(e.trim()),t="";for(let n of r)t&&(t+=" "),n===n.toUpperCase()?t+=n:t+=n[0].toUpperCase()+n.slice(1).toLowerCase();return t}window._=M;})();
1
+ "use strict";(()=>{var N=Object.defineProperty;var I=Object.getOwnPropertySymbols;var tr=Object.prototype.hasOwnProperty,nr=Object.prototype.propertyIsEnumerable;var z=(e,r,t)=>r in e?N(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,V=(e,r)=>{for(var t in r||(r={}))tr.call(r,t)&&z(e,t,r[t]);if(I)for(var t of I(r))nr.call(r,t)&&z(e,t,r[t]);return e};var or=(e,r)=>{for(var t in r)N(e,t,{get:r[t],enumerable:!0})};var y=(e,r,t)=>new Promise((n,o)=>{var i=f=>{try{a(t.next(f))}catch(x){o(x)}},u=f=>{try{a(t.throw(f))}catch(x){o(x)}},a=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,u);a((t=t.apply(e,r)).next())});var M={};or(M,{AbortError:()=>m,TimeoutError:()=>p,camelCase:()=>Je,capitalize:()=>K,chunk:()=>j,clamp:()=>Fe,clone:()=>De,compact:()=>D,countBy:()=>C,debounce:()=>Re,delay:()=>E,difference:()=>d,differenceBy:()=>h,differenceWith:()=>b,drop:()=>L,dropRight:()=>q,dropRightWhile:()=>_,dropWhile:()=>$,fill:()=>Z,flatMap:()=>G,flatten:()=>s,flattenDeep:()=>H,flattenObject:()=>Ce,forEachRight:()=>X,groupBy:()=>J,head:()=>ge,inRange:()=>Ee,initial:()=>Ae,intersection:()=>g,intersectionBy:()=>w,intersectionWith:()=>U,invert:()=>je,isEqual:()=>B,isLength:()=>Ge,isNil:()=>qe,isNotNil:()=>_e,isNull:()=>$e,isPlainObject:()=>F,isUndefined:()=>Ze,kebabCase:()=>Ye,keyBy:()=>Q,last:()=>ke,lowerCase:()=>er,maxBy:()=>Y,mean:()=>P,meanBy:()=>Ke,minBy:()=>ee,negate:()=>Pe,noop:()=>ve,omit:()=>Ie,omitBy:()=>ze,once:()=>We,orderBy:()=>re,partition:()=>te,pick:()=>Ne,pickBy:()=>Ve,random:()=>k,randomInt:()=>A,range:()=>Se,round:()=>Be,sample:()=>ne,sampleSize:()=>oe,shuffle:()=>ie,snakeCase:()=>Qe,startCase:()=>rr,sum:()=>T,sumBy:()=>Me,tail:()=>we,take:()=>ue,takeRight:()=>ae,takeRightWhile:()=>fe,takeWhile:()=>le,throttle:()=>Oe,toFilled:()=>Ue,union:()=>c,unionBy:()=>v,unionWith:()=>O,uniq:()=>R,uniqBy:()=>se,uniqWith:()=>W,unzip:()=>ce,unzipWith:()=>me,withTimeout:()=>Xe,without:()=>be,xor:()=>pe,xorBy:()=>Te,xorWith:()=>xe,zip:()=>ye,zipObject:()=>de,zipWith:()=>he});function j(e,r){if(!Number.isInteger(r)||r<=0)throw new Error("Size must be an integer greater than zero.");let t=Math.ceil(e.length/r),n=Array(t);for(let o=0;o<t;o++){let i=o*r,u=i+r;n[o]=e.slice(i,u)}return n}function D(e){let r=[];for(let t of e)t&&r.push(t);return r}function C(e,r){var n;let t={};for(let o of e){let i=r(o);t[i]=((n=t[i])!=null?n:0)+1}return t}function d(e,r){let t=new Set(r);return e.filter(n=>!t.has(n))}function h(e,r,t){let n=new Set(r.map(o=>t(o)));return e.filter(o=>!n.has(t(o)))}function b(e,r,t){return e.filter(n=>r.every(o=>!t(n,o)))}function L(e,r){return r=Math.max(r,0),e.slice(r)}function q(e,r){return r=Math.min(-r,0),r===0?e.slice():e.slice(0,r)}function _(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(0,t+1);return[]}function $(e,r){let t=e.findIndex(n=>!r(n));return t===-1?[]:e.slice(t)}function Z(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o);for(let a=i;a<u;a++)e[a]=r;return e}function s(e,r=1){let t=[],n=Math.floor(r),o=(i,u)=>{for(let a of i)Array.isArray(a)&&u<n?o(a,u+1):t.push(a)};return o(e,0),t}function G(e,r,t=1){return s(e.map(n=>r(n)),t)}function H(e){return s(e,1/0)}function X(e,r){for(let t=e.length-1;t>=0;t--){let n=e[t];r(n,t,e)}}function J(e,r){let t={};for(let n of e){let o=r(n);t[o]==null&&(t[o]=[]),t[o].push(n)}return t}function g(e,r){let t=new Set(r);return e.filter(n=>t.has(n))}function w(e,r,t){let n=new Set(r.map(t));return e.filter(o=>n.has(t(o)))}function U(e,r,t){return e.filter(n=>r.some(o=>t(n,o)))}function Q(e,r){let t={};for(let n of e){let o=r(n);t[o]=n}return t}function Y(e,r){let t=e[0],n=-1/0;for(let o of e){let i=r(o);i>n&&(n=i,t=o)}return t}function ee(e,r){let t=e[0],n=1/0;for(let o of e){let i=r(o);i<n&&(n=i,t=o)}return t}function re(e,r,t){let n=(i,u,a)=>i<u?a==="asc"?-1:1:i>u?a==="asc"?1:-1:0,o=r.map((i,u)=>t[u]||t[t.length-1]);return e.slice().sort((i,u)=>{for(let a=0;a<r.length;a++){let f=r[a],x=o[a],S=n(i[f],u[f],x);if(S!==0)return S}return 0})}function te(e,r){let t=[],n=[];for(let o of e)r(o)?t.push(o):n.push(o);return[t,n]}function ne(e){let r=Math.floor(Math.random()*e.length);return e[r]}function k(e,r){if(r==null&&(r=e,e=0),e>=r)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(r-e)+e}function A(e,r){return Math.floor(k(e,r))}function oe(e,r){if(r>e.length)throw new Error("Size must be less than or equal to the length of array.");let t=new Array(r),n=new Set;for(let o=e.length-r,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),t[i]=e[u]}return t}function ie(e){let r=e.slice();for(let t=r.length-1;t>=1;t--){let n=Math.floor(Math.random()*(t+1));[r[t],r[n]]=[r[n],r[t]]}return r}function ue(e,r){return e.slice(0,r)}function ae(e,r){return r===0?[]:e.slice(-r)}function fe(e,r){for(let t=e.length-1;t>=0;t--)if(!r(e[t]))return e.slice(t+1);return e.slice()}function le(e,r){let t=[];for(let n of e){if(!r(n))break;t.push(n)}return t}function R(e){return Array.from(new Set(e))}function c(e,r){return R(e.concat(r))}function v(e,r,t){let n=new Map;for(let o of[...e,...r]){let i=t(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function W(e,r){let t=[];for(let n of e)t.every(i=>!r(i,n))&&t.push(n);return t}function O(e,r,t){return W(e.concat(r),t)}function se(e,r){let t=new Map;for(let n of e){let o=r(n);t.has(o)||t.set(o,n)}return Array.from(t.values())}function ce(e){let r=0;for(let n=0;n<e.length;n++)e[n].length>r&&(r=e[n].length);let t=new Array(r);for(let n=0;n<r;n++){t[n]=new Array(e.length);for(let o=0;o<e.length;o++)t[n][o]=e[o][n]}return t}function me(e,r){let t=Math.max(...e.map(o=>o.length)),n=new Array(t);for(let o=0;o<t;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=r(...i)}return n}function pe(e,r){return d(c(e,r),g(e,r))}function Te(e,r,t){let n=v(e,r,t),o=w(e,r,t);return h(n,o,t)}function xe(e,r,t){let n=O(e,r,t),o=U(e,r,t);return b(n,o,t)}function ye(...e){let r=[],t=Math.max(...e.map(n=>n.length));for(let n=0;n<t;n++){let o=[];for(let i of e)o.push(i[n]);r.push(o)}return r}function de(e,r){let t={};for(let n=0;n<e.length;n++)t[e[n]]=r[n];return t}function he(e,...r){let t=[e,...r.slice(0,-1)],n=r[r.length-1],o=[],i=Math.max(...t.map(u=>u.length));for(let u=0;u<i;u++){let a=t.map(f=>f[u]);o.push(n(...a))}return o}function be(e,...r){let t=new Set(r);return e.filter(n=>!t.has(n))}function ge(e){return e[0]}function we(e){let r=e.length;if(r<=1)return[];let t=new Array(r-1);for(let n=1;n<r;n++)t[n-1]=e[n];return t}function Ue(e,r,t=0,n=e.length){let o=e.length,i=Math.max(t>=0?t:o+t,0),u=Math.min(n>=0?n:o+n,o),a=e.slice();for(let f=i;f<u;f++)a[f]=r;return a}function ke(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var m=class extends Error{constructor(r="The operation was aborted"){super(r),this.name="AbortError"}};var p=class extends Error{constructor(r="The operation was timed out"){super(r),this.name="TimeoutError"}};function Re(e,r,{signal:t}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(t!=null&&t.aborted)&&(n=setTimeout(()=>{e(...u),n=null},r))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},t==null||t.addEventListener("abort",i,{once:!0}),o}function ve(){}function We(e){let r=!1,t;return function(){if(r)return t;let n=e();return r=!0,t=n,n}}function Oe(e,r){let t;return function(...o){let i=Date.now();(t==null||i-t>=r)&&(t=i,e(...o))}}function Pe(e){return(...r)=>!e(...r)}function Fe(e,r,t){return t==null?Math.min(e,r):Math.min(Math.max(e,r),t)}function Ee(e,r,t){if(t==null&&(t=r,r=0),r>=t)throw new Error("The maximum value must be greater than the minimum value.");return r<=e&&e<t}function T(e){let r=0;for(let t=0;t<e.length;t++)r+=e[t];return r}function P(e){return T(e)/e.length}function Ke(e,r){let t=e.map(n=>r(n));return P(t)}function Be(e,r=0){if(!Number.isInteger(r))throw new Error("Precision must be an integer.");let t=Math.pow(10,r);return Math.round(e*t)/t}function Me(e,r){let t=e.map(n=>r(n));return T(t)}function Se(e,r,t){if(r==null&&(r=e,e=0),t==null&&(t=1),!Number.isInteger(t)||t===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((r-e)/t),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*t;return o}function Ie(e,r){let t=V({},e);for(let n of r)delete t[n];return t}function ze(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)||(t[n]=o);return t}function Ne(e,r){let t={};for(let n of r)t[n]=e[n];return t}function Ve(e,r){let t={};for(let[n,o]of Object.entries(e))r(o,n)&&(t[n]=o);return t}function je(e){let r={},t=Object.keys(e);for(let n=0;n<t.length;n++){let o=t[n],i=e[o];r[i]=o}return r}function De(e){if(ir(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 r=new Map;for(let[t,n]of e)r.set(t,n);return r}if(e instanceof Set){let r=new Set;for(let t of e)r.add(t);return r}return typeof e=="object"?Object.assign({},e):e}function ir(e){return e==null||typeof e!="object"&&typeof e!="function"}function F(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ce(e){return Le(e)}function Le(e,r=""){let t={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],a=r?`${r}.${i}`:i;if(F(u)&&Object.keys(u).length>0){Object.assign(t,Le(u,a));continue}if(Array.isArray(u)){for(let f=0;f<u.length;f++)t[`${a}.${f}`]=u[f];continue}t[a]=u}return t}function B(e,r){if(Object.is(e,r))return!0;if(e instanceof Date&&r instanceof Date)return e.getTime()===r.getTime();if(e instanceof RegExp&&r instanceof RegExp)return e.source===r.source&&e.flags===r.flags;if(typeof e!="object"||typeof r!="object"||e===null||r===null)return!1;let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length||c(t,n).length!==t.length)return!1;for(let o=0;o<t.length;o++){let i=t[o],u=e[i],a=r[i];if(!B(u,a))return!1}return!0}function qe(e){return e==null}function _e(e){return e!=null}function $e(e){return e===null}function Ze(e){return e===void 0}function Ge(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function E(e,{signal:r}={}){return new Promise((t,n)=>{let o=()=>{n(new m)},i=()=>{clearTimeout(u),o()};if(r!=null&&r.aborted)return o();let u=setTimeout(t,e);r==null||r.addEventListener("abort",i,{once:!0})})}function He(e){return y(this,null,function*(){throw yield E(e),new p})}function Xe(e,r){return y(this,null,function*(){return Promise.race([e(),He(r)])})}var K=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var ur=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function l(e){var r;return Array.from((r=e.match(ur))!=null?r:[])}function Je(e){let r=l(e);if(r.length===0)return"";let[t,...n]=r;return`${t.toLowerCase()}${n.map(o=>K(o)).join("")}`}var Qe=e=>l(e).map(t=>t.toLowerCase()).join("_");var Ye=e=>l(e).map(t=>t.toLowerCase()).join("-");var er=e=>l(e).map(t=>t.toLowerCase()).join(" ");function rr(e){let r=l(e.trim()),t="";for(let n of r)t&&(t+=" "),n===n.toUpperCase()?t+=n:t+=n[0].toUpperCase()+n.slice(1).toLowerCase();return t}window._=M;})();
2
2
  //# sourceMappingURL=browser.global.js.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-WGX4WINP.mjs.map