/** * Copyright (c) 2017-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Alexander Rose * @author Adam Midlik */ /** Assign to the object if a given property in update is undefined */ export declare function assignIfUndefined(to: Partial, full: T): T; /** Create new object if any property in "update" changes in "source". */ export declare function shallowMerge2(source: T, update: Partial): T; export declare function shallowEqual(a: T, b: T): boolean; export declare function shallowMerge(source: T, ...rest: (Partial | undefined)[]): T; export declare function shallowMergeArray(source: T, rest: (Partial | undefined)[]): T; /** Simple deep clone for number, boolean, string, null, undefined, object, array */ export declare function deepClone(source: T): T; /** Return a new object with the same keys, where function `f` is applied to each value. * Equivalent to Pythonic `{k: f(v) for k, v in obj.items()}` */ export declare function mapObjectMap(obj: { [k: string]: T; }, f: (v: T) => S): { [k: string]: S; }; /** Return an object with keys being the elements of `array` and values computed by `getValue` function. * Equivalent to Pythonic `{k: getValue(k) for k in array}` */ export declare function mapArrayToObject(array: readonly K[], getValue: (key: K) => V): Record; export declare function objectForEach(o: T, f: (v: V, k: K) => void): void; /** Return an object with keys `keys` and their values same as in `obj`, i.e. `{ key: obj[key] for key in keys }` */ export declare function pickObjectKeys(obj: T, keys: readonly K[]): Pick; /** Same as `pickObjectKeys` but allows loading values into a different key or skipping keys, i.e. return `{ key: obj[remapping[key] ?? key] for key in keys if remapping[key] !== null }` */ export declare function pickObjectKeysWithRemapping(obj: Record, keys: string[], remapping: Record): Record; export declare function objectOfArraysToArrayOfObjects(objectOfArrays: { [key in keyof T]: T[key][]; }): T[]; /** Return an object same as `obj` but without keys `keys` */ export declare function omitObjectKeys(obj: T, omitKeys: readonly K[]): Omit; /** Create an object from keys and values (first key maps to first value etc.) */ export declare function objectFromKeysAndValues(keys: K[], values: V[]): Record; /** Decide if `obj` is a good old object (not array or null or other type). */ export declare function isPlainObject(obj: any): boolean; /** Like `Promise.all` but with objects instead of arrays */ export declare function promiseAllObj(promisesObj: { [key in keyof T]: Promise; }): Promise;