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

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

Added visualizations

  • Property mode set to 100644
File size: 670 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const fill$1 = require('../../array/fill.js');
6const isArrayLike = require('../predicate/isArrayLike.js');
7const isString = require('../predicate/isString.js');
8
9function fill(array, value, start = 0, end = array ? array.length : 0) {
10 if (!isArrayLike.isArrayLike(array)) {
11 return [];
12 }
13 if (isString.isString(array)) {
14 return array;
15 }
16 start = Math.floor(start);
17 end = Math.floor(end);
18 if (!start) {
19 start = 0;
20 }
21 if (!end) {
22 end = 0;
23 }
24 return fill$1.fill(array, value, start, end);
25}
26
27exports.fill = fill;
Note: See TracBrowser for help on using the repository browser.