#1621·arktype

Add string.boolean.parse keyword

Author: aelesiaCreated May 19, 2026Updated Jun 12, 2026

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.