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

(hotfix): jsonify shouldn't set false to true #19

Merged
merged 1 commit into from
Nov 19, 2019
Merged

Conversation

agilgur5
Copy link
Owner

  • meant to use the previous code as an alternative to using a default
    arg, but !jsonify detects false (etc), not just undefined
    • switched to just using a default arg, which was what I originally
      used before moving defaults outside of the destructuring
    • alternative is to check typeof jsonify === 'undefined' instead
    • default args seem to provide better typings in my experience, so
      stick to that for now

Fixes #17 . Would really like to get #4 done before releasing this for that extra confidence that it actually works though.

- meant to use the previous code as an alternative to using a default
  arg, but `!jsonify` detects false (etc), not just undefined
  - switched to just using a default arg, which was what I originally
    used before moving defaults outside of the destructuring
  - alternative is to check `typeof jsonify === 'undefined'` instead
  - default args seem to provide better typings in my experience, so
    stick to that for now
Copy link
Owner Author

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests in #21 that include one for jsonify = false. This exact code was tested locally against that test, so can be confident that this solution works now!

@agilgur5 agilgur5 merged commit 6b1dd3b into master Nov 19, 2019
@agilgur5 agilgur5 deleted the fix-jsonify branch November 19, 2019 04:39
@agilgur5 agilgur5 added the kind: bug Something isn't working properly or is fixed label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working properly or is fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

options.jsonify is always forced to true
1 participant