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

null is treated as undefined #12

Closed
danielroe opened this issue Jan 15, 2020 · 1 comment
Closed

null is treated as undefined #12

danielroe opened this issue Jan 15, 2020 · 1 comment

Comments

@danielroe
Copy link
Member

When passing in a new object where some of the properties are null, the defaults are used instead. I would expect this only be true for undefined properties.

Repro: https://codesandbox.io/s/defu-repro-o1l04

@pi0
Copy link
Member

pi0 commented Apr 19, 2020

Hi, @danielroe thanks for making the issue.

This is by design that null being skipped as defu was originally written based to be defaults-deep spect compatible and actually for option defaults I think makes sense to disable options via explicit boolean.

I did research these are modules ignoring null:

  • defu
  • defaults-deep
  • assign-deep
  • extend-shallow
  • merge-deep
  • mixin-deep

Modules not ignoring null:

  • omit-deep
  • lodash.defaultsdeep

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