es-toolkit 1.10.1-dev.256 → 1.10.1-dev.258
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/drop.js +1 -0
- package/dist/array/drop.js.map +1 -1
- package/dist/array/drop.mjs +1 -1
- package/dist/array/dropRight.js +5 -1
- package/dist/array/dropRight.js.map +1 -1
- package/dist/array/dropRight.mjs +1 -1
- package/dist/array/index.js +6 -1
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +2 -2
- package/dist/{chunk-S3CORED5.mjs → chunk-3EZAFZG3.mjs} +2 -1
- package/dist/{chunk-S3CORED5.mjs.map → chunk-3EZAFZG3.mjs.map} +1 -1
- package/dist/chunk-OXZCMC5I.mjs +13 -0
- package/dist/{chunk-JEKUA56R.mjs.map → chunk-OXZCMC5I.mjs.map} +1 -1
- package/dist/compat/index.js +6 -1
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +2 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-JEKUA56R.mjs +0 -9
package/dist/compat/index.mjs
CHANGED
|
@@ -213,10 +213,10 @@ import {
|
|
|
213
213
|
} from "../chunk-6NVQAHXP.mjs";
|
|
214
214
|
import {
|
|
215
215
|
drop
|
|
216
|
-
} from "../chunk-
|
|
216
|
+
} from "../chunk-3EZAFZG3.mjs";
|
|
217
217
|
import {
|
|
218
218
|
dropRight
|
|
219
|
-
} from "../chunk-
|
|
219
|
+
} from "../chunk-OXZCMC5I.mjs";
|
|
220
220
|
import {
|
|
221
221
|
dropRightWhile
|
|
222
222
|
} from "../chunk-M7SBBYV2.mjs";
|
package/dist/index.js
CHANGED
|
@@ -206,12 +206,17 @@ function differenceWith(firstArr, secondArr, areItemsEqual) {
|
|
|
206
206
|
|
|
207
207
|
// src/array/drop.ts
|
|
208
208
|
function drop(arr, itemsCount) {
|
|
209
|
+
itemsCount = Math.max(itemsCount, 0);
|
|
209
210
|
return arr.slice(itemsCount);
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
// src/array/dropRight.ts
|
|
213
214
|
function dropRight(arr, itemsCount) {
|
|
214
|
-
|
|
215
|
+
itemsCount = Math.min(-itemsCount, 0);
|
|
216
|
+
if (itemsCount === 0) {
|
|
217
|
+
return arr.slice();
|
|
218
|
+
}
|
|
219
|
+
return arr.slice(0, itemsCount);
|
|
215
220
|
}
|
|
216
221
|
|
|
217
222
|
// src/array/dropRightWhile.ts
|