Closed ulrichb closed 4 years ago
@ulrichb sorry for the delays, but yes, deltas should always contemplate the undefined
value (meaning no diff between left and right). do you think we can add that to the definition of Delta
?
@benjamine Sry, don't use jsondiffpatch
anymore.
This is necessary for TypeScript's --strictNullChecks mode, otherwise the result of
diff()
(which correctly isDelta | undefined
) cannot be provided as input forpatch()
because before this PR it only accepts theDelta
type (withoutundefined
).The corresponding JS: https://github.com/benjamine/jsondiffpatch/blob/0c4323e9bff23ae231f4bff231ceed4df2b48be5/src/filters/trivial.js#L64-L66
An alternative would be to include
undefined
to theDelta
type itself, iff all operations with a Delta input can cope with anundefined
input (which I didn't check).