UNPKG

2.31 kBTypeScriptView Raw
1export declare function iterateObject<T>(object: {
2 [p: string]: T;
3} | T[] | null | undefined, callback: (key: string, value: T) => void): void;
4export declare function cloneObject<T extends {}>(object: T): T;
5export declare function deepCloneObject<T>(object: T): T;
6export declare function deepCloneDefinition<T>(object: T, keysToSkip?: string[]): T | undefined;
7export declare function getProperty<T, K extends keyof T>(object: T, key: K): any;
8export declare function setProperty<T, K extends keyof T>(object: T, key: K, value: any): void;
9/**
10 * Will copy the specified properties from `source` into the equivalent properties on `target`, ignoring properties with
11 * a value of `undefined`.
12 */
13export declare function copyPropertiesIfPresent<S, T extends S, K extends keyof S>(source: S, target: T, ...properties: K[]): void;
14/**
15 * Will copy the specified property from `source` into the equivalent property on `target`, unless the property has a
16 * value of `undefined`. If a transformation is provided, it will be applied to the value before being set on `target`.
17 */
18export declare function copyPropertyIfPresent<S, T extends S, K extends keyof S>(source: S, target: T, property: K, transform?: (value: S[K]) => any): void;
19export declare function getAllKeysInObjects(objects: any[]): string[];
20export declare function getAllValuesInObject<T extends Object>(obj: T): any[];
21export declare function mergeDeep(dest: any, source: any, copyUndefined?: boolean, makeCopyOfSimpleObjects?: boolean): void;
22export declare function assign<T, U>(target: T, source: U): T & U;
23export declare function assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
24export declare function assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
25export declare function missingOrEmptyObject(value: any): boolean;
26export declare function get(source: any, expression: string, defaultValue: any): any;
27export declare function set(target: any, expression: string, value: any): void;
28export declare function deepFreeze(object: any): any;
29export declare function getValueUsingField(data: any, field: string, fieldContainsDots: boolean): any;
30export declare function removeAllReferences(obj: any, objectName: string): void;
31export declare function isNonNullObject(value: any): boolean;