flowjv
Version:
Flow based approach to JSON validation!
15 lines (14 loc) • 767 B
TypeScript
export declare type IKeyPath = (string | number)[];
export declare const stringToKeyPath: (path: string) => (string | number)[];
export declare const normalizeKeyPath: (keyPath: IKeyPath) => (string | number)[];
export declare const set: (obj: any, keyPath: IKeyPath, value: any) => any;
export declare const get: (obj: any, keyPath: IKeyPath, defaultValue?: any) => any;
export declare const unset: (obj: any, keyPath: IKeyPath) => any;
export declare function insertIndex(obj: any, keyPath_: IKeyPath, value?: any): any;
export declare const Immutable: (obj: any) => {
get(keyPath: IKeyPath, defaultValue?: any): any;
set(keyPath: IKeyPath, value: any): any;
unset(keyPath: IKeyPath): any;
insertIndex(keyPath: IKeyPath): void;
value(): any;
};