-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use user's serializer with strict: false
#17
Comments
Can you make an example of what will change in the output? |
If the serialize function is fastRedact({
paths: [...],
strict: false,
serialize: toEDN
})(null) would output the string edn is just an example, of course; any format with different primitive literals (eg, single quoted strings, or 0 and 1 as the representation of true/false) would be effected. |
I agree - would you like to PR? |
Sure, will do |
Edit: thinking about this for a second more, I'm realizing it will change the existing output for non-string primitives with I still think this change is for the best, though, as it separates the question of: "will I get back a string?" (Answer: always yes if *: |
Closing this, as it’s been addressed by #18. |
Looking at #15, it seems like perhaps a better fix would've been:
As long as the serializer is the default
JSON.stringify
, I believe the behavior above would match the behavior in PR #15. But, if the user has customized the serialize function to return something other than JSON, the assumption driving #15 (that the result should always be JSON) seems invalid. It would be more consistent imo to make the redacted output always go throughserialize
, withstrict
being orthogonal.Thoughts?
The text was updated successfully, but these errors were encountered: