MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / createBaseFor

Function createBaseFor

lib/web/jshint.js:4644–4659  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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`

Callers 1

runInContextFunction · 0.85

Calls 1

toObjectFunction · 0.70

Tested by

no test coverage detected