deep-object-diff
deep-object-diff copied to clipboard
Improved index.d.ts to utilize generics that reflect the recursive transformation of array field types into object types
This PR takes #98 a step further to force the type system to reflect the recursive transformation of array field types into the object structure presented in the README examples. Those examples show that we cannot simply use Partial<T>
for the return type of each function. To recap,
diff({ bar: ['a', 'b'] }, { bar: ['a'] }));
Evaluates to:
{
bar: {
'1': undefined
}
}
So the type returned by diff must reflect that as well. That is the purpose of this PR'sDiffRemovable<T>
type.
@mattphillips senpai notice me
@mattphillips +1 senpai