* Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function.
(fromRight)
| 4987 | * @returns {Function} Returns the new base function. |
| 4988 | */ |
| 4989 | function createBaseFor(fromRight) { |
| 4990 | return function(object, iteratee, keysFunc) { |
| 4991 | var index = -1, |
| 4992 | iterable = Object(object), |
| 4993 | props = keysFunc(object), |
| 4994 | length = props.length; |
| 4995 | |
| 4996 | while (length--) { |
| 4997 | var key = props[fromRight ? length : ++index]; |
| 4998 | if (iteratee(iterable[key], key, iterable) === false) { |
| 4999 | break; |
| 5000 | } |
| 5001 | } |
| 5002 | return object; |
| 5003 | }; |
| 5004 | } |
| 5005 | |
| 5006 | /** |
| 5007 | * Creates a function that wraps `func` to invoke it with the optional `this` |