import type { TruthyObject } from '../helpers/utility-types.js'; /****************************************************************************** Types ******************************************************************************/ type IterateCb = (args: { parent: TruthyObject | unknown[]; key: string | number; value: unknown; path: readonly (string | number)[]; }) => void; /****************************************************************************** Functions ******************************************************************************/ /** * Recursively walks plain-objects and arrays, and calls a callback for * every key before descending into nested values. * * - Descends into a value if it is a plain-object or array. * - Fires callback for every entry (including plain-objects/arrays). */ declare function iterate(root: unknown, cb: IterateCb): void; /****************************************************************************** Export ******************************************************************************/ export default iterate;