MCPcopy
hub / github.com/Crosstalk-Solutions/project-nomad / parseBoolean

Function parseBoolean

admin/app/utils/misc.ts:15–25  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

13}
14
15export function parseBoolean(value: any): boolean {
16 if (typeof value === 'boolean') return value
17 if (typeof value === 'string') {
18 const lower = value.toLowerCase()
19 return lower === 'true' || lower === '1'
20 }
21 if (typeof value === 'number') {
22 return value === 1
23 }
24 return false
25}

Callers 2

ChatModalFunction · 0.90
getValueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected