es-toolkit 1.10.1-dev.243 → 1.10.1-dev.245

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.
@@ -215,7 +215,7 @@ import {
215
215
  } from "../chunk-LJ2C6MVP.mjs";
216
216
  import {
217
217
  fill
218
- } from "../chunk-6KP7CLVJ.mjs";
218
+ } from "../chunk-YFN6KOC4.mjs";
219
219
  import {
220
220
  flatMap
221
221
  } from "../chunk-UY76KTPE.mjs";
package/dist/index.js CHANGED
@@ -212,13 +212,14 @@ function dropWhile(arr, canContinueDropping) {
212
212
  }
213
213
 
214
214
  // src/array/fill.ts
215
- function fill(arr, value, start = 0, end = arr.length) {
216
- start = Math.max(start, 0);
217
- end = Math.min(end, arr.length);
218
- for (let i = start; i < end; i++) {
219
- arr[i] = value;
215
+ function fill(array, value, start = 0, end = array.length) {
216
+ const length = array.length;
217
+ const finalStart = Math.max(start >= 0 ? start : length + start, 0);
218
+ const finalEnd = Math.min(end >= 0 ? end : length + end, length);
219
+ for (let i = finalStart; i < finalEnd; i++) {
220
+ array[i] = value;
220
221
  }
221
- return arr;
222
+ return array;
222
223
  }
223
224
 
224
225
  // src/array/flatten.ts