Files
HRM-System/node_modules/es-toolkit/dist/compat/object/forInRight.mjs
2026-04-13 08:19:53 +08:00

22 lines
495 B
JavaScript

import { identity } from '../../function/identity.mjs';
function forInRight(object, iteratee = identity) {
if (object == null) {
return object;
}
const keys = [];
for (const key in object) {
keys.push(key);
}
for (let i = keys.length - 1; i >= 0; i--) {
const key = keys[i];
const result = iteratee(object[key], key, object);
if (result === false) {
break;
}
}
return object;
}
export { forInRight };