* 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.
(fromRight)
| 4642 | * @returns {Function} Returns the new base function. |
| 4643 | */ |
| 4644 | function createBaseFor(fromRight) { |
| 4645 | return function(object, iteratee, keysFunc) { |
| 4646 | var iterable = toObject(object), |
| 4647 | props = keysFunc(object), |
| 4648 | length = props.length, |
| 4649 | index = fromRight ? length : -1; |
| 4650 | |
| 4651 | while ((fromRight ? index-- : ++index < length)) { |
| 4652 | var key = props[index]; |
| 4653 | if (iteratee(iterable[key], key, iterable) === false) { |
| 4654 | break; |
| 4655 | } |
| 4656 | } |
| 4657 | return object; |
| 4658 | }; |
| 4659 | } |
| 4660 | |
| 4661 | /** |
| 4662 | * Creates a function that wraps `func` and invokes it with the `this` |
no test coverage detected