main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
515 bytes
|
Line | |
---|
1 | import baseSlice from './_baseSlice.js';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Casts `array` to a slice if it's needed.
|
---|
5 | *
|
---|
6 | * @private
|
---|
7 | * @param {Array} array The array to inspect.
|
---|
8 | * @param {number} start The start position.
|
---|
9 | * @param {number} [end=array.length] The end position.
|
---|
10 | * @returns {Array} Returns the cast slice.
|
---|
11 | */
|
---|
12 | function castSlice(array, start, end) {
|
---|
13 | var length = array.length;
|
---|
14 | end = end === undefined ? length : end;
|
---|
15 | return (!start && end >= length) ? array : baseSlice(array, start, end);
|
---|
16 | }
|
---|
17 |
|
---|
18 | export default castSlice;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.