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

miniscore _.defaults works bad with nulls #41

Open
0xF013 opened this issue Mar 18, 2015 · 1 comment · May be fixed by #43
Open

miniscore _.defaults works bad with nulls #41

0xF013 opened this issue Mar 18, 2015 · 1 comment · May be fixed by #43

Comments

@0xF013
Copy link

0xF013 commented Mar 18, 2015

https://github.com/weluse/hyperagent/blob/master/lib/hyperagent/miniscore.js#L76
this line causes null properties returned after a forces fetch to not overwrite the old value. Lodash's _.defaults only checks for undefined and has nulls as acceptable values

@passy
Copy link
Contributor

passy commented Apr 20, 2015

@0xF013 Cheers, underscore does the same thing. I'll update it accordingly.

passy added a commit that referenced this issue Apr 20, 2015
Adjust the _.defaults behavior to match that of underscore and lodash to
no longer treat `null` and `undefined` the same and only consider
`undefined` for override.
@passy passy linked a pull request Apr 20, 2015 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants