playcanvas
Version:
PlayCanvas WebGL game engine
21 lines (20 loc) • 751 B
TypeScript
/**
* Map utility functions.
*
* @ignore
*/
export class MapUtils {
/**
* Merges multiple maps into a new Map instance. If multiple maps contain the same key, the
* value from the later map in the arguments list takes precedence.
*
* Null or undefined maps are safely handled and skipped during the merge process.
*
* @param {...(Map|null|undefined)} maps - Maps to merge.
* @returns {Map} A new Map containing all entries from the input maps with conflicts resolved.
* @example
* // Create a merged map where entries from map2 override entries from map1
* const mergedMap = MapUtils.merge(map1, map2);
*/
static merge(...maps: (Map<any, any> | null | undefined)[]): Map<any, any>;
}