UNPKG

lodash-walk-object

Version:

Walk all properties deep in object with lodash help

74 lines (72 loc) 2.19 kB
// @ts-nocheck declare namespace Models { type InDBType = { target: any; path: string; }; type Circ = { pathToObj: string; circuralTargetPath: string; }; type Ver = { v: any; p: string; parent: Ver; isGetter?: boolean; }; interface StartIteratorOptions { walkGetters?: boolean; /** * Default in breadhTwalk */ checkCircural?: boolean; breadthWalk?: boolean; include?: string[]; exclude?: string[]; } interface AdditionalIteratorOptions extends StartIteratorOptions { skipObject?: () => void; isGetter?: boolean; /** * Breadth walk will skip content of circural objects */ isCircural?: boolean; exit?: () => void; } interface InternalValues extends AdditionalIteratorOptions { db?: any; stack?: any[]; circural?: Circ[]; hasIterator?: boolean; _valueChanged: boolean; _skip: boolean; _exit: boolean; } } type Iterator = (value: any, lodashPath: string, changeValueTo: (newValue: any) => void, options?: Models.AdditionalIteratorOptions) => void; declare class Helpers { static get Walk(): { Object(json: Object, iterator: Iterator, optionsOrWalkGettersValue?: Models.StartIteratorOptions): { circs: Models.Circ[]; }; ObjectBy(property: string, inContext: Object, iterator: Iterator, options?: Models.StartIteratorOptions): { circs: Models.Circ[]; }; }; private static _changeValue; private static _prepareParams; private static get _Helpers(); private static _shoudlReturn; private static prepareOptions; private static _walk; } declare const walk: { Object: (json: Object, iterator: Iterator, optionsOrWalkGettersValue?: Models.StartIteratorOptions) => { circs: Models.Circ[]; }; ObjectBy: (property: string, inContext: Object, iterator: Iterator, options?: Models.StartIteratorOptions) => { circs: Models.Circ[]; }; }; export { Helpers, Models, walk }; export type { Iterator };