UNPKG

type-plus

Version:
10 lines (8 loc) 293 B
import type { KeyTypes } from './KeyTypes.js' export function forEachKey<S extends Record<KeyTypes, any>, T = any>( subject: S, predicate: (this: T, key: keyof S, index: number, obj: Array<keyof S>) => void, thisArg?: T ): void { return Object.keys(subject).forEach(predicate, thisArg) }