sfcode
An Online Competing and Development Environment
|
Parse yes/no like values
Useful for validating answers of a CLI prompt.
The following case-insensitive values are recognized:
Enable lenient mode to gracefully handle typos.
Unrecognized values return null
.
Type: any
Value that should be converted.
Type: Object
Type: boolean
Default: false
Use a key distance-based score to leniently accept typos of yes
and no
.
Type: boolean
Default: null
Default value if no match was found.
MIT © Sindre Sorhus