You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
493 B

import { keys } from './_internals/keys.js'
export function forEachObjIndexedFn(fn, obj){
let index = 0
const listKeys = keys(obj)
const len = listKeys.length
while (index < len){
const key = listKeys[ index ]
fn(
obj[ key ], key, obj
)
index++
}
return obj
}
export function forEachObjIndexed(fn, list){
if (arguments.length === 1) return _list => forEachObjIndexed(fn, _list)
if (list === undefined) return
return forEachObjIndexedFn(fn, list)
}