We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customMerge()
Problem: We'd like to require certain merge paths to always be defined.
For example: If attempting to merge objects a and b, and b.properties is defined, we'd like to throw if `a.properties is not defined.
a
b
b.properties
Current solution: Per this comment, this is accomplished with a customMerge function that looks something like this:
// merge options customMerge(key) { if (key === 'properties') { return function (a, b) { if (!a) throw Error('properties is not defined'); } } }
This is awkward. It's just weird that the test for property name and value(s) is split across two different functions.
Proposed solution: Extend the customMerge() method signature to take key, object_a, object_b. This would allow the code above to be simplified:
key, object_a, object_b
// merge options customMerge(key, a, b) { if (key === 'properties' && !a) { throw Error('properties is not defined'); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem: We'd like to require certain merge paths to always be defined.
For example: If attempting to merge objects
a
andb
, andb.properties
is defined, we'd like to throw if `a.properties is not defined.Current solution:
Per this comment, this is accomplished with a customMerge function that looks something like this:
This is awkward. It's just weird that the test for property name and value(s) is split across two different functions.
Proposed solution:
Extend the
customMerge()
method signature to takekey, object_a, object_b
. This would allow the code above to be simplified:The text was updated successfully, but these errors were encountered: