es-toolkit 1.12.0-dev.270 → 1.12.0-dev.272

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.
@@ -1,28 +1,7 @@
1
1
  import "../chunk-DDH7K4QM.mjs";
2
- import {
3
- xorBy
4
- } from "../chunk-Q47NGNXT.mjs";
5
- import {
6
- xorWith
7
- } from "../chunk-QRSJBBFY.mjs";
8
- import {
9
- zip
10
- } from "../chunk-IDCUZVJL.mjs";
11
- import {
12
- zipObject
13
- } from "../chunk-6GWEY5EL.mjs";
14
2
  import {
15
3
  zipWith
16
4
  } from "../chunk-4KYXHZ4R.mjs";
17
- import {
18
- unionWith
19
- } from "../chunk-2ZCITDMK.mjs";
20
- import {
21
- uniqBy
22
- } from "../chunk-B4COTK4K.mjs";
23
- import {
24
- uniqWith
25
- } from "../chunk-237HGSZS.mjs";
26
5
  import {
27
6
  unzip
28
7
  } from "../chunk-UYZKMBDO.mjs";
@@ -36,17 +15,17 @@ import {
36
15
  xor
37
16
  } from "../chunk-L7FQX5MN.mjs";
38
17
  import {
39
- tail
40
- } from "../chunk-OF6NM4G7.mjs";
18
+ xorBy
19
+ } from "../chunk-Q47NGNXT.mjs";
41
20
  import {
42
- take
43
- } from "../chunk-ME352XO7.mjs";
21
+ xorWith
22
+ } from "../chunk-QRSJBBFY.mjs";
44
23
  import {
45
- takeRight
46
- } from "../chunk-IQLKIDXF.mjs";
24
+ zip
25
+ } from "../chunk-IDCUZVJL.mjs";
47
26
  import {
48
- takeRightWhile
49
- } from "../chunk-NTLX2MPV.mjs";
27
+ zipObject
28
+ } from "../chunk-6GWEY5EL.mjs";
50
29
  import {
51
30
  takeWhile
52
31
  } from "../chunk-2IXFGSUA.mjs";
@@ -56,24 +35,21 @@ import {
56
35
  import {
57
36
  union
58
37
  } from "../chunk-R6QA7PLZ.mjs";
59
- import {
60
- uniq
61
- } from "../chunk-DVK2N4KC.mjs";
62
38
  import {
63
39
  unionBy
64
40
  } from "../chunk-NFS7RWWE.mjs";
65
41
  import {
66
- last
67
- } from "../chunk-KPBQ7OUY.mjs";
42
+ unionWith
43
+ } from "../chunk-2ZCITDMK.mjs";
68
44
  import {
69
- maxBy
70
- } from "../chunk-OOKNBU4V.mjs";
45
+ uniq
46
+ } from "../chunk-DVK2N4KC.mjs";
71
47
  import {
72
- minBy
73
- } from "../chunk-IJD7FE2Z.mjs";
48
+ uniqBy
49
+ } from "../chunk-B4COTK4K.mjs";
74
50
  import {
75
- orderBy
76
- } from "../chunk-7B7W36UP.mjs";
51
+ uniqWith
52
+ } from "../chunk-237HGSZS.mjs";
77
53
  import {
78
54
  partition
79
55
  } from "../chunk-DN3NOZ3H.mjs";
@@ -89,14 +65,17 @@ import {
89
65
  shuffle
90
66
  } from "../chunk-G7UQ5PUR.mjs";
91
67
  import {
92
- groupBy
93
- } from "../chunk-E6E4RZLN.mjs";
68
+ tail
69
+ } from "../chunk-OF6NM4G7.mjs";
94
70
  import {
95
- head
96
- } from "../chunk-HM2JT2RX.mjs";
71
+ take
72
+ } from "../chunk-ME352XO7.mjs";
97
73
  import {
98
- initial
99
- } from "../chunk-XPSOKBRZ.mjs";
74
+ takeRight
75
+ } from "../chunk-IQLKIDXF.mjs";
76
+ import {
77
+ takeRightWhile
78
+ } from "../chunk-NTLX2MPV.mjs";
100
79
  import {
101
80
  intersection
102
81
  } from "../chunk-FVVSE2F2.mjs";
@@ -110,17 +89,17 @@ import {
110
89
  keyBy
111
90
  } from "../chunk-AJKZMN2V.mjs";
112
91
  import {
113
- dropRight
114
- } from "../chunk-OXZCMC5I.mjs";
92
+ last
93
+ } from "../chunk-KPBQ7OUY.mjs";
115
94
  import {
116
- dropRightWhile
117
- } from "../chunk-M7SBBYV2.mjs";
95
+ maxBy
96
+ } from "../chunk-OOKNBU4V.mjs";
118
97
  import {
119
- dropWhile
120
- } from "../chunk-LJ2C6MVP.mjs";
98
+ minBy
99
+ } from "../chunk-IJD7FE2Z.mjs";
121
100
  import {
122
- fill
123
- } from "../chunk-YFN6KOC4.mjs";
101
+ orderBy
102
+ } from "../chunk-7B7W36UP.mjs";
124
103
  import {
125
104
  flatMap
126
105
  } from "../chunk-UY76KTPE.mjs";
@@ -134,14 +113,14 @@ import {
134
113
  forEachRight
135
114
  } from "../chunk-IEA53J7P.mjs";
136
115
  import {
137
- chunk
138
- } from "../chunk-E6C5EZQA.mjs";
116
+ groupBy
117
+ } from "../chunk-E6E4RZLN.mjs";
139
118
  import {
140
- compact
141
- } from "../chunk-DTJJIMKJ.mjs";
119
+ head
120
+ } from "../chunk-HM2JT2RX.mjs";
142
121
  import {
143
- countBy
144
- } from "../chunk-CRSKT4WW.mjs";
122
+ initial
123
+ } from "../chunk-XPSOKBRZ.mjs";
145
124
  import {
146
125
  difference
147
126
  } from "../chunk-JPUKH67K.mjs";
@@ -154,6 +133,27 @@ import {
154
133
  import {
155
134
  drop
156
135
  } from "../chunk-3EZAFZG3.mjs";
136
+ import {
137
+ dropRight
138
+ } from "../chunk-OXZCMC5I.mjs";
139
+ import {
140
+ dropRightWhile
141
+ } from "../chunk-M7SBBYV2.mjs";
142
+ import {
143
+ dropWhile
144
+ } from "../chunk-LJ2C6MVP.mjs";
145
+ import {
146
+ fill
147
+ } from "../chunk-YFN6KOC4.mjs";
148
+ import {
149
+ chunk
150
+ } from "../chunk-E6C5EZQA.mjs";
151
+ import {
152
+ compact
153
+ } from "../chunk-DTJJIMKJ.mjs";
154
+ import {
155
+ countBy
156
+ } from "../chunk-CRSKT4WW.mjs";
157
157
  import "../chunk-424M7IR7.mjs";
158
158
  export {
159
159
  chunk,
@@ -1,6 +1,5 @@
1
1
  export { compact } from '../array/compact.mjs';
2
2
  export { countBy } from '../array/countBy.mjs';
3
- export { difference } from '../array/difference.mjs';
4
3
  export { differenceBy } from '../array/differenceBy.mjs';
5
4
  export { differenceWith } from '../array/differenceWith.mjs';
6
5
  export { drop } from '../array/drop.mjs';
@@ -110,6 +109,8 @@ export { capitalize } from '../string/capitalize.mjs';
110
109
  */
111
110
  declare function chunk<T>(arr: readonly T[], size?: number): T[][];
112
111
 
112
+ declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
113
+
113
114
  /**
114
115
  * Creates a deeply nested object given arrays of paths and values.
115
116
  *
@@ -497,4 +498,4 @@ declare function max<T>(items?: readonly T[]): T;
497
498
  */
498
499
  declare function min<T>(items?: readonly T[]): T;
499
500
 
500
- export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
501
+ export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
@@ -1,6 +1,5 @@
1
1
  export { compact } from '../array/compact.js';
2
2
  export { countBy } from '../array/countBy.js';
3
- export { difference } from '../array/difference.js';
4
3
  export { differenceBy } from '../array/differenceBy.js';
5
4
  export { differenceWith } from '../array/differenceWith.js';
6
5
  export { drop } from '../array/drop.js';
@@ -110,6 +109,8 @@ export { capitalize } from '../string/capitalize.js';
110
109
  */
111
110
  declare function chunk<T>(arr: readonly T[], size?: number): T[][];
112
111
 
112
+ declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
113
+
113
114
  /**
114
115
  * Creates a deeply nested object given arrays of paths and values.
115
116
  *
@@ -497,4 +498,4 @@ declare function max<T>(items?: readonly T[]): T;
497
498
  */
498
499
  declare function min<T>(items?: readonly T[]): T;
499
500
 
500
- export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
501
+ export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
@@ -65,7 +65,7 @@ __export(compat_exports, {
65
65
  countBy: () => countBy,
66
66
  debounce: () => debounce,
67
67
  delay: () => delay,
68
- difference: () => difference,
68
+ difference: () => difference2,
69
69
  differenceBy: () => differenceBy,
70
70
  differenceWith: () => differenceWith,
71
71
  drop: () => drop,
@@ -1076,6 +1076,13 @@ function chunk2(arr, size = 1) {
1076
1076
  return chunk(arr, size);
1077
1077
  }
1078
1078
 
1079
+ // src/compat/array/difference.ts
1080
+ function difference2(arr, ...values) {
1081
+ const arr1 = arr;
1082
+ const arr2 = flatten(values);
1083
+ return difference(arr1, arr2);
1084
+ }
1085
+
1079
1086
  // src/compat/_internal/isIndex.ts
1080
1087
  var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
1081
1088
  function isIndex(value) {