|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
610 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const dropRight$1 = require('../../array/dropRight.js');
|
|---|
| 6 | const toArray = require('../_internal/toArray.js');
|
|---|
| 7 | const isArrayLike = require('../predicate/isArrayLike.js');
|
|---|
| 8 | const toInteger = require('../util/toInteger.js');
|
|---|
| 9 |
|
|---|
| 10 | function dropRight(collection, itemsCount = 1, guard) {
|
|---|
| 11 | if (!isArrayLike.isArrayLike(collection)) {
|
|---|
| 12 | return [];
|
|---|
| 13 | }
|
|---|
| 14 | itemsCount = guard ? 1 : toInteger.toInteger(itemsCount);
|
|---|
| 15 | return dropRight$1.dropRight(toArray.toArray(collection), itemsCount);
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | exports.dropRight = dropRight;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.