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.
@@ -213,10 +213,10 @@ import {
213
213
  } from "../chunk-6NVQAHXP.mjs";
214
214
  import {
215
215
  drop
216
- } from "../chunk-S3CORED5.mjs";
216
+ } from "../chunk-3EZAFZG3.mjs";
217
217
  import {
218
218
  dropRight
219
- } from "../chunk-JEKUA56R.mjs";
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
- return arr.slice(0, -itemsCount);
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