source: node_modules/es-toolkit/dist/compat/array/fill.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 559 bytes
RevLine 
[a762898]1import { fill as fill$1 } from '../../array/fill.mjs';
2import { isArrayLike } from '../predicate/isArrayLike.mjs';
3import { isString } from '../predicate/isString.mjs';
4
5function fill(array, value, start = 0, end = array ? array.length : 0) {
6 if (!isArrayLike(array)) {
7 return [];
8 }
9 if (isString(array)) {
10 return array;
11 }
12 start = Math.floor(start);
13 end = Math.floor(end);
14 if (!start) {
15 start = 0;
16 }
17 if (!end) {
18 end = 0;
19 }
20 return fill$1(array, value, start, end);
21}
22
23export { fill };
Note: See TracBrowser for help on using the repository browser.