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

"strict" mode that throws when undefined values found #82

Open
simlu opened this issue Aug 18, 2019 · 1 comment
Open

"strict" mode that throws when undefined values found #82

simlu opened this issue Aug 18, 2019 · 1 comment

Comments

@simlu
Copy link

simlu commented Aug 18, 2019

We would love a "strict" option where the library raises when an unknown value is found.

Use case is that often objects get composed directly as a parameter for objectHash. Hence it's hard to get visibility into what is actually hashed. Raising on undefined would ensure that at least something meaningful was put into the object before hashing it.

@simlu simlu changed the title Option "strict" mode that throws when undefined values found "strict" mode that throws when undefined values found Aug 18, 2019
@simlu
Copy link
Author

simlu commented Aug 20, 2019

I realize now that my suggestion was silly, since this library hashes absolutely everything it can get its hand on :) So there will always be something undefined.

What makes sense though it to check if there are any "real" values that are undefined.

I've started working on that in this pr: https://github.com/blackflux/object-hash-strict/pull/3/files

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

1 participant