|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
570 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { identity } from '../../function/identity.mjs';
|
|---|
| 2 | import { negate } from '../../function/negate.mjs';
|
|---|
| 3 | import { toArray } from '../_internal/toArray.mjs';
|
|---|
| 4 | import { isArrayLikeObject } from '../predicate/isArrayLikeObject.mjs';
|
|---|
| 5 | import { iteratee } from '../util/iteratee.mjs';
|
|---|
| 6 |
|
|---|
| 7 | function takeRightWhile(_array, predicate) {
|
|---|
| 8 | if (!isArrayLikeObject(_array)) {
|
|---|
| 9 | return [];
|
|---|
| 10 | }
|
|---|
| 11 | const array = toArray(_array);
|
|---|
| 12 | const index = array.findLastIndex(negate(iteratee(predicate ?? identity)));
|
|---|
| 13 | return array.slice(index + 1);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | export { takeRightWhile };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.