jslib-nightly
Version:
SheerID JavaScript Library
15 lines (14 loc) • 643 B
TypeScript
export declare function deepClone<T>(obj: T): T;
/**
* Avoid "can't access property of undefined" errors in a more readable way.
* @param fn Function that wraps a nested property access
* @param defaultVal Optional - the value to return if property access failed
*/
export declare function getSafe<T>(fn: () => T, defaultVal?: T): T | undefined;
/**
* Performs a deep merge of `source` into `target`.
* Mutates `target` only but not its objects and arrays.
*
* @author inspired from https://gist.github.com/ahtcx/0cd94e62691f539160b32ecda18af3d6#gistcomment-3120712
*/
export declare function deepMerge(...objects: object[]): object;