MCPcopy
hub / github.com/bestony/logoly / parseBoolean

Function parseBoolean

src/utils/persistentState.js:21–28  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

19const isString = (value) => typeof value === 'string';
20
21function parseBoolean(value) {
22 if (typeof value === 'boolean') return value;
23 const normalized = String(value).trim().toLowerCase();
24 if (!normalized) return undefined;
25 if (['1', 'true', 'yes', 'y'].includes(normalized)) return true;
26 if (['0', 'false', 'no', 'n'].includes(normalized)) return false;
27 return undefined;
28}
29
30function parseNumber(value) {
31 if (value === null || value === undefined || value === '') return undefined;

Callers 1

pickValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected