UNPKG

molstar

Version:

A comprehensive macromolecular library.

24 lines (23 loc) 1.13 kB
/** * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> */ /** Assign to the object if a given property in update is undefined */ export declare function assignIfUndefined<T>(to: Partial<T>, full: T): T; /** Create new object if any property in "update" changes in "source". */ export declare function shallowMerge2<T>(source: T, update: Partial<T>): T; export declare function shallowEqual<T>(a: T, b: T): boolean; export declare function shallowMerge<T>(source: T, ...rest: (Partial<T> | undefined)[]): T; export declare function shallowMergeArray<T>(source: T, rest: (Partial<T> | undefined)[]): T; /** Simple deep clone for number, boolean, string, null, undefined, object, array */ export declare function deepClone<T>(source: T): T; export declare function mapObjectMap<T, S>(o: { [k: string]: T; }, f: (v: T) => S): { [k: string]: S; }; export declare function objectForEach<T>(o: { [k: string]: T; }, f: (v: T, k: string) => void): void;