UNPKG

lodash-walk-object

Version:

Walk all properties deep in object with lodash help

75 lines (74 loc) 2.27 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 interface Models__NS__InDBType { target: any; path: string; } export interface Models__NS__Ver { v: any; p: string; parent: Models__NS__Ver; isGetter?: boolean; } export interface Models__NS__StartIteratorOptions { walkGetters?: boolean; /** * Default in breadhTwalk */ checkCircural?: boolean; breadthWalk?: boolean; include?: string[]; exclude?: string[]; } export interface Models__NS__AdditionalIteratorOptions extends Models__NS__StartIteratorOptions { skipObject?: () => void; isGetter?: boolean; /** * Breadth walk will skip content of circural objects */ isCircural?: boolean; exit?: () => void; } export interface Models__NS__InternalValues extends Models__NS__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__NS__AdditionalIteratorOptions) => void; export declare class Helpers { static get Walk(): { Object(json: Object, iterator: Iterator, optionsOrWalkGettersValue?: Models__NS__StartIteratorOptions): { circs: Circ[]; }; ObjectBy(property: string, inContext: Object, iterator: Iterator, options?: Models__NS__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__NS__StartIteratorOptions) => { circs: Circ[]; }; ObjectBy: (property: string, inContext: Object, iterator: Iterator, options?: Models__NS__StartIteratorOptions) => { circs: Circ[]; }; };