es-toolkit 1.3.1-dev.78 → 1.3.1-dev.80

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 (43) hide show
  1. package/dist/array/index.js +9 -2
  2. package/dist/array/index.js.map +1 -1
  3. package/dist/array/index.mjs +27 -27
  4. package/dist/array/unionBy.js +1 -1
  5. package/dist/array/unionBy.js.map +1 -1
  6. package/dist/array/unionBy.mjs +1 -1
  7. package/dist/array/uniqBy.js +6 -13
  8. package/dist/array/uniqBy.js.map +1 -1
  9. package/dist/array/uniqBy.mjs +1 -2
  10. package/dist/array/xorBy.js +1 -1
  11. package/dist/array/xorBy.js.map +1 -1
  12. package/dist/array/xorBy.mjs +2 -2
  13. package/dist/{chunk-EW3RT4QW.mjs → chunk-AM2EGFCU.mjs} +2 -2
  14. package/dist/chunk-LJHSPVPM.mjs +12 -0
  15. package/dist/chunk-LJHSPVPM.mjs.map +1 -0
  16. package/dist/chunk-NNIW65CD.mjs +1 -0
  17. package/dist/{chunk-JBDGK6X4.mjs → chunk-NRNKP6JF.mjs} +2 -2
  18. package/dist/{chunk-JBDGK6X4.mjs.map → chunk-NRNKP6JF.mjs.map} +1 -1
  19. package/dist/chunk-WPDDOUQT.mjs +16 -0
  20. package/dist/chunk-WPDDOUQT.mjs.map +1 -0
  21. package/dist/index.d.mts +1 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +19 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +38 -34
  26. package/dist/math/index.d.mts +1 -0
  27. package/dist/math/index.d.ts +1 -0
  28. package/dist/math/index.js +10 -0
  29. package/dist/math/index.js.map +1 -1
  30. package/dist/math/index.mjs +5 -1
  31. package/dist/math/random.d.mts +15 -0
  32. package/dist/math/random.d.ts +15 -0
  33. package/dist/math/random.js +36 -0
  34. package/dist/math/random.js.map +1 -0
  35. package/dist/math/random.mjs +8 -0
  36. package/dist/math/random.mjs.map +1 -0
  37. package/dist/object/index.mjs +3 -3
  38. package/package.json +1 -1
  39. package/dist/chunk-ASFOKYTY.mjs +0 -13
  40. package/dist/chunk-ASFOKYTY.mjs.map +0 -1
  41. package/dist/chunk-IJLQVGW4.mjs +0 -1
  42. /package/dist/{chunk-EW3RT4QW.mjs.map → chunk-AM2EGFCU.mjs.map} +0 -0
  43. /package/dist/{chunk-IJLQVGW4.mjs.map → chunk-NNIW65CD.mjs.map} +0 -0
@@ -0,0 +1,36 @@
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/math/random.ts
21
+ var random_exports = {};
22
+ __export(random_exports, {
23
+ random: () => random
24
+ });
25
+ module.exports = __toCommonJS(random_exports);
26
+ function random(minimum, maximum) {
27
+ if (minimum >= maximum) {
28
+ throw new Error("Invalid input: The maximum value must be greater than the minimum value.");
29
+ }
30
+ return Math.random() * (maximum - minimum) + minimum;
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ random
35
+ });
36
+ //# sourceMappingURL=random.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/math/random.ts"],"sourcesContent":["/**\n * Generates a random floating-point number between minimum (inclusive) and maximum (exclusive).\n * If min is greater than maximum, the values are swapped.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random integer between minimum (inclusive) and maximum (exclusive).\n *\n * @example\n * const result = random(0, 5); // result will be a random floating-point number between 0 (inclusive) and 5 (exclusive)\n * const result2 = random(5, 0); // This will throw an error\n */\nexport function random(minimum: number, maximum: number): number {\n if (minimum >= maximum) {\n throw new Error('Invalid input: The maximum value must be greater than the minimum value.');\n }\n\n return Math.random() * (maximum - minimum) + minimum;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,OAAO,SAAiB,SAAyB;AAC/D,MAAI,WAAW,SAAS;AACtB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AAEA,SAAO,KAAK,OAAO,KAAK,UAAU,WAAW;AAC/C;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ random
3
+ } from "../chunk-LJHSPVPM.mjs";
4
+ import "../chunk-2MM5EJJX.mjs";
5
+ export {
6
+ random
7
+ };
8
+ //# sourceMappingURL=random.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,7 @@
1
1
  import "../chunk-T5JCRGXA.mjs";
2
+ import {
3
+ pickBy
4
+ } from "../chunk-T2C2WVFL.mjs";
2
5
  import {
3
6
  omit
4
7
  } from "../chunk-PLTO44KM.mjs";
@@ -8,9 +11,6 @@ import {
8
11
  import {
9
12
  pick
10
13
  } from "../chunk-OFWKFUFZ.mjs";
11
- import {
12
- pickBy
13
- } from "../chunk-T2C2WVFL.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  omit,
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.3.1-dev.78+8d80869f",
4
+ "version": "1.3.1-dev.80+60e79741",
5
5
  "workspaces": [
6
6
  "docs"
7
7
  ],
@@ -1,13 +0,0 @@
1
- import {
2
- uniqWith
3
- } from "./chunk-2PFDLYQC.mjs";
4
-
5
- // src/array/uniqBy.ts
6
- function uniqBy(arr, mapper) {
7
- return uniqWith(arr, (item1, item2) => mapper(item1) === mapper(item2));
8
- }
9
-
10
- export {
11
- uniqBy
12
- };
13
- //# sourceMappingURL=chunk-ASFOKYTY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["import { uniqWith } from './uniqWith';\n\n/**\n * Returns a new array containing only the unique elements from the original array,\n * based on the values returned by the mapper function.\n *\n * @param {T[]} arr - The array to process.\n * @param {(item: T) => U} mapper - The function used to convert the array elements.\n * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function.\n *\n * @example\n * ```ts\n * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n * // [1.2, 2.1, 3.3, 5.7, 7.19]\n * ```\n */\nexport function uniqBy<T, U>(arr: readonly T[], mapper: (item: T) => U): T[] {\n return uniqWith(arr, (item1, item2) => mapper(item1) === mapper(item2));\n}\n"],"mappings":";;;;;AAgBO,SAAS,OAAa,KAAmB,QAA6B;AAC3E,SAAO,SAAS,KAAK,CAAC,OAAO,UAAU,OAAO,KAAK,MAAM,OAAO,KAAK,CAAC;AACxE;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-IJLQVGW4.mjs.map