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