We are enhancing the Neo.mergeDeepArrays method to support a smarter merge strategy for arrays containing objects.
Current Behavior:
The current implementation performs a set-based union for arrays, or simple replacement.
New Behavior:
The enhanced implementation will iterate through the source array and the new array.
- It will attempt to match items based on an
id or name property.
- If a match is found, it will recursively deep merge the objects using
Neo.mergeDeepArrays.
- If no match is found by key, it will check for deep equality.
- New items are appended.
- Duplicates (by deep equality) are avoided.
This enhancement allows for extending configuration arrays (like fields_ in Data Models) where subclasses can override or extend specific items from the parent class without redefining the entire array.
Use Case:
Allowing Portal.model.TicketTimelineSection to inherit fields from Portal.model.ContentSection and merge in new fields, while keeping the shared fields defined in the base class.
We are enhancing the
Neo.mergeDeepArraysmethod to support a smarter merge strategy for arrays containing objects.Current Behavior: The current implementation performs a set-based union for arrays, or simple replacement.
New Behavior: The enhanced implementation will iterate through the source array and the new array.
idornameproperty.Neo.mergeDeepArrays.This enhancement allows for extending configuration arrays (like
fields_in Data Models) where subclasses can override or extend specific items from the parent class without redefining the entire array.Use Case: Allowing
Portal.model.TicketTimelineSectionto inheritfieldsfromPortal.model.ContentSectionand merge in new fields, while keeping the shared fields defined in the base class.