unis_crm/frontend1/node_modules/@rc-component/util/es/utils/set.d.ts

19 lines
814 B
TypeScript
Raw Normal View History

2026-03-26 09:29:55 +00:00
export type Path = (string | number | symbol)[];
export default function set<Entity = any, Output = Entity, Value = any>(entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean): Output;
export type MergeFn = (current: any, next: any) => any;
/**
* Merge multiple objects. Support custom merge logic.
* @param sources object sources
* @param config.prepareArray Customize array prepare function.
* It will return empty [] by default.
* So when match array, it will auto be override with next array in sources.
*/
export declare function mergeWith<T extends object>(sources: T[], config?: {
prepareArray?: MergeFn;
}): T;
/**
* Merge multiple objects into a new single object.
* Arrays will be replaced by default.
*/
export declare function merge<T extends object>(...sources: T[]): T;