Merging algorithm
Last updated
Last updated
When composing stamps you actually merge their (aka metadata).
The Object.assign
is used for these descriptor properties:
The special deep merging algorithm (see below) is used for these descriptor properties:
The array concatenation and deduplication (see below) is used for these descriptor properties:
This is how initializers and composers metadata gets merged.
Plain objects are (recursively) deep merged, including ES6 Symbol keys, ES5 getters and setters.
Arrays are concatenated.
Functions, Symbols, RegExp, etc. values are copied by reference.
The last object type overwrites previous object type.
The merged result of the two objects above will be this:
See the of the reference implementation source code.
The standardized the deep merging algorithm to, basically, this:
See the of the reference implementation source code.