Skip to content
New issue

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

delete return value #2

Closed
edwardsmarkf opened this issue Jan 27, 2017 · 1 comment
Closed

delete return value #2

edwardsmarkf opened this issue Jan 27, 2017 · 1 comment

Comments

@edwardsmarkf
Copy link

edwardsmarkf commented Jan 27, 2017

could we include this gist with deep-object-diff and use a parameter with detailedDifference( function?

something like:

detailedDifference(lhs, rhs, null);   // return null rather than undefined
detailedDifference(lhs, rhs, '{}' ) ;   // return {} rather than undefined
@mattphillips
Copy link
Owner

I think the value of undefined has the correct semantic meaning in that the value has been deleted and is now undefined. This change would also mean changing the API for 2 of the 5 available functions (deletedDiff and detailedDiff) which ideally would all remain the same.

I've just updated the gist to use the correct variable name on line 32 - which shows how to map the undefined values to a null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants