|
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
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { fill as fill$1 } from '../../array/fill.mjs';
|
|---|
| 2 | import { isArrayLike } from '../predicate/isArrayLike.mjs';
|
|---|
| 3 | import { isString } from '../predicate/isString.mjs';
|
|---|
| 4 |
|
|---|
| 5 | function 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 |
|
|---|
| 23 | export { fill };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.