MCPcopy Index your code
hub / github.com/simstudioai/sim / optionalBoolean

Function optionalBoolean

apps/sim/blocks/blocks/microsoft_excel.ts:35–41  ·  view source on GitHub ↗

Coerces a 'true'/'false' dropdown value to boolean, or `undefined` when unset.

(value: unknown)

Source from the content-addressed store, hash-verified

33
34/** Coerces a 'true'/'false' dropdown value to boolean, or `undefined` when unset. */
35function optionalBoolean(value: unknown): boolean | undefined {
36 const str = optionalString(value)
37 if (str === undefined) return undefined
38 if (str === 'true') return true
39 if (str === 'false') return false
40 return undefined
41}
42
43/** Coerces a numeric input value to number, or `undefined` when unset or invalid. */
44function optionalNumber(value: unknown): number | undefined {

Callers 1

microsoft_excel.tsFile · 0.85

Calls 1

optionalStringFunction · 0.70

Tested by

no test coverage detected