-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Should throw if falsey key value exists #1
Comments
Ah, right, good catch~! I'll fix this, but we should also be paving on Slightly unrelated, but thoughts about not throwing if a value exists? Instead, would silently break & exit. |
I wouldn't pave over a I'm a big fan of throwing when there is an exception. Hiding/masking the problem will make it harder to track down the root cause. Actually, you might want to use this instead: x = keys[i] in o ? o[keys[i]] : {}; |
That'd throw immediately for anything that isn't already an object, including |
* fix: TS .d.ts resolution (#1) There are types at '/node_modules/dset/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'dset' library may need to update its package.json or typings.ts(7016) * Update package.json (#2) * Simplified package exports * Updated back to original repo * Update package.json --------- Co-authored-by: Luke Edwards <[email protected]>
In your example, if
foo.d
is already set to say5
, it throws. I would expect that. However, if it is0
(or anything falsey), it paves over the falsey value.A possible fix is:
The text was updated successfully, but these errors were encountered: