Repository URL to install this package:
|
Version:
1.2.10 ▾
|
"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
};