|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
427 bytes
|
| Line | |
|---|
| 1 | import { take as take$1 } from '../../array/take.mjs';
|
|---|
| 2 | import { toArray } from '../_internal/toArray.mjs';
|
|---|
| 3 | import { isArrayLike } from '../predicate/isArrayLike.mjs';
|
|---|
| 4 | import { toInteger } from '../util/toInteger.mjs';
|
|---|
| 5 |
|
|---|
| 6 | function take(arr, count = 1, guard) {
|
|---|
| 7 | count = guard ? 1 : toInteger(count);
|
|---|
| 8 | if (count < 1 || !isArrayLike(arr)) {
|
|---|
| 9 | return [];
|
|---|
| 10 | }
|
|---|
| 11 | return take$1(toArray(arr), count);
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | export { take };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.