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.
- package/dist/array/fill.d.mts +9 -6
- package/dist/array/fill.d.ts +9 -6
- package/dist/array/fill.js +7 -6
- package/dist/array/fill.js.map +1 -1
- package/dist/array/fill.mjs +1 -1
- package/dist/array/index.js +7 -6
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +1 -1
- package/dist/chunk-YFN6KOC4.mjs +15 -0
- package/dist/chunk-YFN6KOC4.mjs.map +1 -0
- package/dist/compat/index.js +7 -6
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6KP7CLVJ.mjs +0 -14
- package/dist/chunk-6KP7CLVJ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
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.10.1-dev.
|
|
4
|
+
"version": "1.10.1-dev.245+553f136c",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|
package/dist/chunk-6KP7CLVJ.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/array/fill.ts
|
|
2
|
-
function fill(arr, value, start = 0, end = arr.length) {
|
|
3
|
-
start = Math.max(start, 0);
|
|
4
|
-
end = Math.min(end, arr.length);
|
|
5
|
-
for (let i = start; i < end; i++) {
|
|
6
|
-
arr[i] = value;
|
|
7
|
-
}
|
|
8
|
-
return arr;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
fill
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-6KP7CLVJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/fill.ts"],"sourcesContent":["/**\n * Fills elements of an array with a specified value from the start position up to, but not including, the end position.\n *\n * This function mutates the original array and replaces its elements with the provided value, starting from the specified\n * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the\n * entire array.\n *\n * @param {Array<T | P>} arr - The array to fill.\n * @param {P} value - The value to fill the array with.\n * @param {number} [start=0] - The start position. Defaults to 0.\n * @param {number} [end=arr.length] - The end position. Defaults to the array's length.\n * @returns {Array<T | P>} The array with the filled values.\n *\n * @example\n * const array = [1, 2, 3];\n * const result = fill(array, 'a');\n * // => ['a', 'a', 'a']\n *\n * const result = fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * const result = fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n\nexport function fill<T>(arr: unknown[], value: T): T[];\nexport function fill<T, P>(arr: Array<T | P>, value: P, start: number): Array<T | P>;\nexport function fill<T, P>(arr: Array<T | P>, value: P, start: number, end: number): Array<T | P>;\nexport function fill<T, P>(arr: Array<T | P>, value: P, start = 0, end = arr.length): Array<T | P> {\n start = Math.max(start, 0);\n end = Math.min(end, arr.length);\n\n for (let i = start; i < end; i++) {\n arr[i] = value;\n }\n\n return arr;\n}\n"],"mappings":";AA4BO,SAAS,KAAW,KAAmB,OAAU,QAAQ,GAAG,MAAM,IAAI,QAAsB;AACjG,UAAQ,KAAK,IAAI,OAAO,CAAC;AACzB,QAAM,KAAK,IAAI,KAAK,IAAI,MAAM;AAE9B,WAAS,IAAI,OAAO,IAAI,KAAK,KAAK;AAChC,QAAI,CAAC,IAAI;AAAA,EACX;AAEA,SAAO;AACT;","names":[]}
|