Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / chain-able / src / deps / loop / each / baseFor.js
Size: Mime:
"use strict";

/**
 * The base implementation of `baseForOwn` which iterates over `object`
 * properties returned by `keysFunc` and invokes `iteratee` for each property.
 * Iteratee functions may exit iteration early by explicitly returning `false`.
 * @since 5.0.0-beta.6
 * @memberOf loop
 *
 * @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`.
 * @return {Object} Returns `object`.
 *
 */
function baseFor(object, iteratee, keysFunc) {
  const iterable = Object(object);
  const props = keysFunc(object);
  let length = props.length;
  let index = -1;

  while (length--) {
    const key = props[++index];

    if (iteratee(iterable[key], key, iterable) === false) {
      break;
    }
  }

  return object;
}

module.exports = baseFor;