es-toolkit 1.1.0 → 1.2.0-dev.51

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 (60) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/array/difference.d.mts +1 -1
  3. package/dist/array/difference.d.ts +1 -1
  4. package/dist/array/difference.js +2 -3
  5. package/dist/array/difference.js.map +1 -1
  6. package/dist/array/difference.mjs +1 -1
  7. package/dist/array/differenceBy.d.mts +1 -1
  8. package/dist/array/differenceBy.d.ts +1 -1
  9. package/dist/array/differenceBy.js +2 -2
  10. package/dist/array/differenceBy.js.map +1 -1
  11. package/dist/array/differenceBy.mjs +1 -1
  12. package/dist/array/index.js +8 -8
  13. package/dist/array/index.js.map +1 -1
  14. package/dist/array/index.mjs +5 -5
  15. package/dist/array/shuffle.js +4 -3
  16. package/dist/array/shuffle.js.map +1 -1
  17. package/dist/array/shuffle.mjs +1 -1
  18. package/dist/array/xor.js +2 -3
  19. package/dist/array/xor.js.map +1 -1
  20. package/dist/array/xor.mjs +2 -2
  21. package/dist/array/xorBy.js +2 -2
  22. package/dist/array/xorBy.js.map +1 -1
  23. package/dist/array/xorBy.mjs +2 -2
  24. package/dist/{chunk-TULUUJ3E.mjs → chunk-4PNP6CKQ.mjs} +2 -2
  25. package/dist/chunk-HK5OJANS.mjs +12 -0
  26. package/dist/{chunk-PUQLVKMB.mjs.map → chunk-HK5OJANS.mjs.map} +1 -1
  27. package/dist/chunk-KPG3XQEN.mjs +14 -0
  28. package/dist/chunk-KPG3XQEN.mjs.map +1 -0
  29. package/dist/chunk-LKXCOLNY.mjs +8 -0
  30. package/dist/chunk-LKXCOLNY.mjs.map +1 -0
  31. package/dist/chunk-N6EM6ETS.mjs +1 -0
  32. package/dist/chunk-SORNYLIU.mjs +10 -0
  33. package/dist/{chunk-2PB2OCC6.mjs.map → chunk-SORNYLIU.mjs.map} +1 -1
  34. package/dist/{chunk-QC3SFAQJ.mjs → chunk-VKVA56XG.mjs} +2 -2
  35. package/dist/function/index.d.mts +1 -0
  36. package/dist/function/index.d.ts +1 -0
  37. package/dist/function/index.js +6 -0
  38. package/dist/function/index.js.map +1 -1
  39. package/dist/function/index.mjs +8 -4
  40. package/dist/function/noop.d.mts +12 -0
  41. package/dist/function/noop.d.ts +12 -0
  42. package/dist/function/noop.js +32 -0
  43. package/dist/function/noop.js.map +1 -0
  44. package/dist/function/noop.mjs +8 -0
  45. package/dist/function/noop.mjs.map +1 -0
  46. package/dist/index.d.mts +1 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +14 -8
  49. package/dist/index.js.map +1 -1
  50. package/dist/index.mjs +22 -18
  51. package/dist/predicate/index.mjs +3 -3
  52. package/package.json +1 -1
  53. package/dist/chunk-23DC774L.mjs +0 -13
  54. package/dist/chunk-23DC774L.mjs.map +0 -1
  55. package/dist/chunk-2PB2OCC6.mjs +0 -11
  56. package/dist/chunk-PUQLVKMB.mjs +0 -12
  57. package/dist/chunk-SYQTG4N4.mjs +0 -1
  58. /package/dist/{chunk-TULUUJ3E.mjs.map → chunk-4PNP6CKQ.mjs.map} +0 -0
  59. /package/dist/{chunk-SYQTG4N4.mjs.map → chunk-N6EM6ETS.mjs.map} +0 -0
  60. /package/dist/{chunk-QC3SFAQJ.mjs.map → chunk-VKVA56XG.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -16,6 +16,9 @@ import {
16
16
  pickBy
17
17
  } from "./chunk-T2C2WVFL.mjs";
18
18
  import "./chunk-MAJSPFA6.mjs";
19
+ import {
20
+ isNotNil
21
+ } from "./chunk-ZQNAZPSK.mjs";
19
22
  import {
20
23
  isNull
21
24
  } from "./chunk-Y6ZRNII6.mjs";
@@ -25,19 +28,6 @@ import {
25
28
  import {
26
29
  isNil
27
30
  } from "./chunk-KBJTBR5T.mjs";
28
- import {
29
- isNotNil
30
- } from "./chunk-ZQNAZPSK.mjs";
31
- import "./chunk-SYQTG4N4.mjs";
32
- import {
33
- debounce
34
- } from "./chunk-GELVVASW.mjs";
35
- import {
36
- once
37
- } from "./chunk-UFAA5WKR.mjs";
38
- import {
39
- throttle
40
- } from "./chunk-XLO3QZVY.mjs";
41
31
  import "./chunk-IJLQVGW4.mjs";
42
32
  import {
43
33
  clamp
@@ -48,16 +38,29 @@ import {
48
38
  import {
49
39
  sum
50
40
  } from "./chunk-B5P232BA.mjs";
41
+ import "./chunk-N6EM6ETS.mjs";
42
+ import {
43
+ throttle
44
+ } from "./chunk-XLO3QZVY.mjs";
45
+ import {
46
+ debounce
47
+ } from "./chunk-GELVVASW.mjs";
48
+ import {
49
+ noop
50
+ } from "./chunk-LKXCOLNY.mjs";
51
+ import {
52
+ once
53
+ } from "./chunk-UFAA5WKR.mjs";
51
54
  import "./chunk-EJGAXTF7.mjs";
52
55
  import {
53
56
  uniqBy
54
57
  } from "./chunk-TK2EDHSP.mjs";
55
58
  import {
56
59
  xor
57
- } from "./chunk-QC3SFAQJ.mjs";
60
+ } from "./chunk-VKVA56XG.mjs";
58
61
  import {
59
62
  xorBy
60
- } from "./chunk-TULUUJ3E.mjs";
63
+ } from "./chunk-4PNP6CKQ.mjs";
61
64
  import {
62
65
  xorWith
63
66
  } from "./chunk-TCHT4HCP.mjs";
@@ -69,7 +72,7 @@ import {
69
72
  } from "./chunk-PRTIPC5X.mjs";
70
73
  import {
71
74
  shuffle
72
- } from "./chunk-23DC774L.mjs";
75
+ } from "./chunk-KPG3XQEN.mjs";
73
76
  import {
74
77
  take
75
78
  } from "./chunk-OLBUAFBX.mjs";
@@ -120,10 +123,10 @@ import {
120
123
  } from "./chunk-OS5PZ4B4.mjs";
121
124
  import {
122
125
  difference
123
- } from "./chunk-2PB2OCC6.mjs";
126
+ } from "./chunk-SORNYLIU.mjs";
124
127
  import {
125
128
  differenceBy
126
- } from "./chunk-PUQLVKMB.mjs";
129
+ } from "./chunk-HK5OJANS.mjs";
127
130
  import {
128
131
  differenceWith
129
132
  } from "./chunk-M3SHJ3LL.mjs";
@@ -160,6 +163,7 @@ export {
160
163
  isNotNil,
161
164
  isNull,
162
165
  isUndefined,
166
+ noop,
163
167
  omit,
164
168
  omitBy,
165
169
  once,
@@ -1,4 +1,7 @@
1
1
  import "../chunk-MAJSPFA6.mjs";
2
+ import {
3
+ isNotNil
4
+ } from "../chunk-ZQNAZPSK.mjs";
2
5
  import {
3
6
  isNull
4
7
  } from "../chunk-Y6ZRNII6.mjs";
@@ -8,9 +11,6 @@ import {
8
11
  import {
9
12
  isNil
10
13
  } from "../chunk-KBJTBR5T.mjs";
11
- import {
12
- isNotNil
13
- } from "../chunk-ZQNAZPSK.mjs";
14
14
  import "../chunk-2MM5EJJX.mjs";
15
15
  export {
16
16
  isNil,
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.1.0",
4
+ "version": "1.2.0-dev.51+eb514b7a",
5
5
  "workspaces": [
6
6
  "docs"
7
7
  ],
@@ -1,13 +0,0 @@
1
- // src/array/shuffle.ts
2
- function shuffle(arr) {
3
- for (let i = arr.length - 1; i >= 1; i--) {
4
- const j = Math.floor(Math.random() * (i + 1));
5
- [arr[i], arr[j]] = [arr[j], arr[i]];
6
- }
7
- return arr;
8
- }
9
-
10
- export {
11
- shuffle
12
- };
13
- //# sourceMappingURL=chunk-23DC774L.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/array/shuffle.ts"],"sourcesContent":["/**\n * Randomizes the order of elements in an array using the Fisher-Yates algorithm.\n *\n * This function takes an array and returns a new array with its elements shuffled in a random order.\n *\n * @param {T[]} arr - The array to shuffle.\n * @returns {T[]} A new array with its elements shuffled in random order.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const shuffledArray = shuffle(array);\n * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2]\n */\nexport function shuffle<T>(arr: T[]): T[] {\n /**\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n for (let i = arr.length - 1; i >= 1; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n\n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n\n return arr;\n}\n"],"mappings":";AAaO,SAAS,QAAW,KAAe;AAIxC,WAAS,IAAI,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK;AACxC,UAAM,IAAI,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,EAAE;AAE5C,KAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;","names":[]}
@@ -1,11 +0,0 @@
1
- // src/array/difference.ts
2
- function difference(firstArr, secondArr) {
3
- return firstArr.filter((item) => {
4
- return !secondArr.includes(item);
5
- });
6
- }
7
-
8
- export {
9
- difference
10
- };
11
- //# sourceMappingURL=chunk-2PB2OCC6.mjs.map
@@ -1,12 +0,0 @@
1
- // src/array/differenceBy.ts
2
- function differenceBy(firstArr, secondArr, mapper) {
3
- const mappedSecondArr = secondArr.map((item) => mapper(item));
4
- return firstArr.filter((item) => {
5
- return !mappedSecondArr.includes(mapper(item));
6
- });
7
- }
8
-
9
- export {
10
- differenceBy
11
- };
12
- //# sourceMappingURL=chunk-PUQLVKMB.mjs.map
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-SYQTG4N4.mjs.map