MCPcopy Create free account
hub / github.com/JacobLinCool/LeetCode-Stats-Card / booleanize

Function booleanize

packages/cloudflare-worker/src/utils.ts:5–22  ·  view source on GitHub ↗
(value: string | boolean)

Source from the content-addressed store, hash-verified

3}
4
5export function booleanize(value: string | boolean): boolean {
6 if (typeof value === "boolean") return value;
7
8 const F = [
9 "false",
10 "null",
11 "0",
12 "undefined",
13 "no",
14 "none",
15 "off",
16 "disable",
17 "disabled",
18 "nan",
19 "",
20 ];
21 return !F.includes(value.toLowerCase());
22}

Callers 2

handleCssRulesFunction · 0.90
sanitizeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected