Standardized merge algorithm
In this release the deep merging algorithm has been standardised. It is:
- Plain objects are deeply merged.
- Array are concatenated.
- Everything else (including Symbols) is copied by assignment.
const ReferencedStamp = compose();
const FirstStamp = compose({deepProperties: {
anotherStamp: null
}});
const SecondStamp = compose({deepProperties: {
anotherStamp: ReferencedStamp
}});
const CombinedStamp = compose(FirstStamp, SecondStamp);
const stampFromMetadata = CombinedStamp.compose.deepProperties.anotherStamp;
Previously the stampFromMetadata
was a POJO:
Object.getPrototypeOf(stampFromMetadata) === Object.prototype
With this release it will be copied by reference:
stampFromMetadata === ReferencedStamp