Sha256: f515a515a04eb9e96fc209216203c636957fa35e6ff89e672d9093a482ed6de0
Contents?: true
Size: 709 Bytes
Versions: 153
Compression:
Stored size: 709 Bytes
Contents
var toObject = require('./toObject'); /** * Creates a base function for `_.forIn` or `_.forInRight`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { var key = props[index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor;
Version data entries
153 entries across 80 versions & 8 rubygems