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 / forProto.js
Size: Mime:
"use strict";

const getPrototypeOf = require("../../util/getPrototypeOf"); // function forOwnAndProto() {}


module.exports = function forProto(obj, fn, max = 11) {
  let current = obj;
  let index = 0; // would be result for `mapProto`
  // let result = []

  while (current = getPrototypeOf(current)) {
    if (index++ > max) break;
    fn(current, index);
  } // return result

};