basant307/AI_Governance_Project
045
1import baseFor from './_baseFor.js';2import castFunction from './_castFunction.js';3import keysIn from './keysIn.js';4 5/**6 * Iterates over own and inherited enumerable string keyed properties of an7 * object and invokes `iteratee` for each property. The iteratee is invoked8 * with three arguments: (value, key, object). Iteratee functions may exit9 * iteration early by explicitly returning `false`.10 *11 * @static12 * @memberOf _13 * @since 0.3.014 * @category Object15 * @param {Object} object The object to iterate over.16 * @param {Function} [iteratee=_.identity] The function invoked per iteration.17 * @returns {Object} Returns `object`.18 * @see _.forInRight19 * @example20 *21 * function Foo() {22 * this.a = 1;23 * this.b = 2;24 * }25 *26 * Foo.prototype.c = 3;27 *28 * _.forIn(new Foo, function(value, key) {29 * console.log(key);30 * });31 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).32 */33function forIn(object, iteratee) {34 return object == null35 ? object36 : baseFor(object, castFunction(iteratee), keysIn);37}38 39export default forIn;40 