source: node_modules/es-toolkit/dist/compat/object/forInRight.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 495 bytes
Line 
1import { identity } from '../../function/identity.mjs';
2
3function forInRight(object, iteratee = identity) {
4 if (object == null) {
5 return object;
6 }
7 const keys = [];
8 for (const key in object) {
9 keys.push(key);
10 }
11 for (let i = keys.length - 1; i >= 0; i--) {
12 const key = keys[i];
13 const result = iteratee(object[key], key, object);
14 if (result === false) {
15 break;
16 }
17 }
18 return object;
19}
20
21export { forInRight };
Note: See TracBrowser for help on using the repository browser.