UNPKG

nani

Version:

Better error handling for Node

19 lines (18 loc) 901 B
import { IterItem } from "./iter-item"; /** * Internal resursive iteration utility. * * @remarks * This function is ultimately responsible for all iteration operations in * external functions. It will generate objects for each item in an error * structure, including each item, its parent, and whether or not the item was * in an array on the parent. It will also detect any circular references and * terminate them, preventing infinite loops. * * @param err - Error instance to iterate. * @param parent - Parent of `err`, if any. * @param inArray - Set to true if `err` is in an `errors` array on `parent`. * @param seen - Set of Errors that have already been encountered along the * current chain. Used to check for circular references. */ export declare function iterateInternal(err: Error, parent?: Error | null, inArray?: boolean, seen?: Set<Error>): IterableIterator<IterItem>;