source: node_modules/es-toolkit/dist/compat/array/takeRightWhile.js@ a762898

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
RevLine 
[a762898]1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const identity = require('../../function/identity.js');
6const negate = require('../../function/negate.js');
7const toArray = require('../_internal/toArray.js');
8const isArrayLikeObject = require('../predicate/isArrayLikeObject.js');
9const iteratee = require('../util/iteratee.js');
10
11function 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
20exports.takeRightWhile = takeRightWhile;
Note: See TracBrowser for help on using the repository browser.