Skip to content

detect more boolean types for boolean|long api type #246

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Grinnz
Copy link

@Grinnz Grinnz commented Jun 10, 2025

Suggested fix for #245 by inverting the logic, since looks_like_number accepts too many valid inputs. Attempts to detect a boolean first, and only if that does not return true or false, return a number.

Additionally expands boolean detection using is_bool from JSON::MaybeXS (notably this supports the new builtin booleans, which on recent Perls can be returned by builtin::true or operators such as !).

Copy link

cla-checker-service bot commented Jun 10, 2025

💚 CLA has been signed

@Grinnz
Copy link
Author

Grinnz commented Jun 10, 2025

I'd like to add tests for this but I'm not sure where to begin.

@Grinnz Grinnz force-pushed the api-boolean-detection branch from ea567d2 to ee6a134 Compare June 10, 2025 02:48
@Grinnz Grinnz force-pushed the api-boolean-detection branch from ee6a134 to 45184ba Compare June 10, 2025 02:52
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.

1 participant