UNPKG

lodash-walk-object

Version:

Walk all properties deep in object with lodash help

77 lines (76 loc) 2.29 kB
export interface Circ { /** * This path value will be overriten with circural object value */ pathToObj: string; /** * lodash path to circural objects * OR * actual object for circural mapping */ circuralTargetPath: string | any; } export declare namespace Models { interface InDBType { target: any; path: string; } interface 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 { stack?: any[]; circural?: Circ[]; hasIterator?: boolean; _valueChanged: boolean; _skip: boolean; _exit: boolean; } } export type Iterator = (value: any, lodashPath: string, changeValueTo: (newValue: any) => void, options?: Models.AdditionalIteratorOptions) => void; export declare class Helpers { static get Walk(): { Object(json: Object, iterator: Iterator, optionsOrWalkGettersValue?: Models.StartIteratorOptions): { circs: Circ[]; }; ObjectBy(property: string, inContext: Object, iterator: Iterator, options?: Models.StartIteratorOptions): { circs: Circ[]; }; }; private static _changeValue; private static _prepareParams; private static get _Helpers(); private static _shoudlReturn; private static prepareOptions; private static _walk; } export declare const walk: { Object: (json: Object, iterator: Iterator, optionsOrWalkGettersValue?: Models.StartIteratorOptions) => { circs: Circ[]; }; ObjectBy: (property: string, inContext: Object, iterator: Iterator, options?: Models.StartIteratorOptions) => { circs: Circ[]; }; };