Files
lodash/.internal/baseForRight.js

26 lines
683 B
JavaScript

/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
function baseForRight(object, iteratee, keysFunc) {
const iterable = Object(object)
const props = keysFunc(object)
let { length } = props;
while (length--) {
const key = props[length];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object
}
export default baseForRight