Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Conversation

@ianjennings
Copy link

During development I found that "true" and "false" are always converted into strings, leaving no ability to compare against booleans.

This patch adds support for bools through the : operator.

EX:

?param=:true 
@Starefossen
Copy link
Contributor

Thanks for the pull request @ianjennings and sorry for the late response!

I am tempted to propose that this should be done by default? We already parses numbers, I think that "true" and "false" string values should be parsed to true and false boolean values by default. What do you think?

@ianjennings
Copy link
Author

From a usability standpoint, that's what I expected from the library. It wasn't until I echo'd the generated query that I saw bool values interpreted as a string.

👍 I vote to parse booleans by default.

@Starefossen
Copy link
Contributor

Boolean parsing has been implemented by #11 and released in v2.0.0 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants