Hi there !
Thank you for supporting the plugin it's really great.
Unfortunately currently I have an issue with merging configuration fragments that contain elements in array which are objects. Take the 2 logically identical fragments for merging:
Due to the fact that uniqueness of the array elements is shallow the {Ref: componentsBucket} element will be added to the merged array which is not what we expect. current code in merge.ts:10 :
if (Array.isArray(target) && Array.isArray(source)) {
// add unique elements of source into target
return target.concat(source.filter(elem => !target.includes(elem)))
}
To make it work not only for string elements you could consider using lodash differenceWith and isEqual functions to perform a deep array elements comparison. proposed solution:
if (Array.isArray(target) && Array.isArray(source)) {
// add unique elements of source into target with deep elements equality comparison
return target.concat(differenceWith(source, target, isEqual));
}
If you agree with the proposed solution, could you kindly accept the PR and publish a new version to npm repository?
Hi there ! Thank you for supporting the plugin it's really great. Unfortunately currently I have an issue with merging configuration fragments that contain elements in array which are objects. Take the 2 logically identical fragments for merging:
Due to the fact that uniqueness of the array elements is shallow the {Ref: componentsBucket} element will be added to the merged array which is not what we expect. current code in merge.ts:10 :
To make it work not only for string elements you could consider using lodash differenceWith and isEqual functions to perform a deep array elements comparison. proposed solution:
If you agree with the proposed solution, could you kindly accept the PR and publish a new version to npm repository?