Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anomalyco/opencode-sdk-python
/ coerce_boolean
Function
coerce_boolean
src/opencode_ai/_utils/_utils.py:325–326 ·
view source on GitHub ↗
(val: str)
Source
from the content-addressed store, hash-verified
323
324
325
def
coerce_boolean(val: str) -> bool:
326
return
val ==
"true"
or val ==
"1"
or val ==
"on"
327
328
329
def
maybe_coerce_integer(val: str | None) -> int | None:
Callers
2
BaseModel
Class · 0.85
maybe_coerce_boolean
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected