MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / toBoolean

Function toBoolean

web/src/helpers/boolean.js:1–10  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1export const toBoolean = (value) => {
2 // 兼容字符串、数字以及布尔原生类型
3 if (typeof value === 'boolean') return value;
4 if (typeof value === 'number') return value === 1;
5 if (typeof value === 'string') {
6 const v = value.toLowerCase();
7 return v === 'true' || v === '1';
8 }
9 return false;
10};

Callers 9

getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90
getOptionsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected