UNPKG

my-test123

Version:
34 lines (33 loc) 842 B
export interface modelUI { id: string; name?: string; } export declare class modelService { id?: string; type: string; } export interface MapTree { [index: number]: { fromPath?: string[]; toPath?: string[]; toValue?: any; toFunction?: any; }; length: number; } export interface Mapper<I, O> { uiToServiceMapTree: MapTree; serviceToUiMapTree: MapTree; toUIModel(data: I): O; toServiceModel(data: O): I; } export declare function switchModel<I, O>(input: I, mapTree: MapTree): O; /** * * @param obj the object to be cleaned * @param keys the keys in the object to be clened * * Any property with value null will be deleted * Any property mentioned in the key array will be deleted */ export declare function cleanObject(obj: any, keysToRemove?: string[]): any;