Request a feature
Add string.boolean.parse to support parsing boolean strings
🤷 Motivation
string.integer.parse and string.numeric.parse exist, but there's no equivalent for booleans. Parsing "true"/"false" strings from environment variables, query params, and serialized data is a common use case.
💡 Solution
Add string.boolean and string.boolean.parse following the exact same pattern as stringInteger/stringNumeric in string.ts. Validate that the string is "true" | "false", then morph it into a boolean
Happy to open a PR for this.
Request a feature
Add
string.boolean.parseto support parsing boolean strings🤷 Motivation
string.integer.parseandstring.numeric.parseexist, but there's no equivalent forbooleans. Parsing "true"/"false" strings from environment variables, query params, and serialized data is a common use case.💡 Solution
Add
string.booleanandstring.boolean.parsefollowing the exact same pattern as stringInteger/stringNumeric instring.ts. Validate that the string is "true" | "false", then morph it into a booleanHappy to open a PR for this.