export type CollectionForIn<Value> = Array<Value> | {} | Iterator<Value> | Value
// extends keyof CollectionForIn<Value>
export interface Iteratee<Value, Prop = any> extends Function {
(
value: Value,
prop: Prop,
collection: Array<Value> | {} | Iterator<Value>
): any
}
/**
* @desc loop for in, no checks on hasOwnProperty, useful for flattening proto
* @since 5.0.0-beta.6
* @memberOf loop
* @curried 2
*
* @param collection collection to iterate
* @param iteratee The function invoked per iteration
* @return collection
*/
export default function forInUnguarded<Value>(
collection: Array<Value> | {} | Iterator<Value>,
iteratee: Iteratee<Value>
) {
// eslint-disable-next-line
for (let prop in collection) iteratee(collection[prop], prop, collection)
return collection
}