Skip to content

Conversation

scottmatthewman
Copy link
Owner

Booleans can now be formatted in one of several ways:

  • true/false
  • TRUE/FALSE
  • yes/no
  • YES/NO
  • 1/0
  • with custom true/false strings

This is governed by a new strategy added to CSVEncoderConfiguration. The default is .trueFalse, which is the same as the previous hardcoded encoding.

Closes #2.

This adds support for encoding boolean values in a variety of ways:

- true/false (the default)
- TRUE/FALSE
- yes/no
- YES/NO
- 1/0
- Custom user-supplied strings
Rather than having a switch statement with identical ternary checks,
move the true/false values to be computed properties on the strategy
enum, which then simplifies the encode function.
@scottmatthewman scottmatthewman merged commit d810868 into main Jan 3, 2024
@scottmatthewman scottmatthewman deleted the boolean-encoding branch January 3, 2024 19:27
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

Successfully merging this pull request may close these issues.

Add a configuration strategy for Boolean encoding

1 participant