MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / parseBooleanEnv

Function parseBooleanEnv

src/cli.ts:1036–1053  ·  view source on GitHub ↗
(value: unknown, defaultValue = false)

Source from the content-addressed store, hash-verified

1034}
1035
1036function parseBooleanEnv(value: unknown, defaultValue = false): boolean {
1037 const normalized = String(value ?? '').trim().toLowerCase();
1038 if (!normalized) {
1039 return defaultValue;
1040 }
1041 if (
1042 normalized === '0'
1043 || normalized === 'false'
1044 || normalized === 'no'
1045 || normalized === 'off'
1046 ) {
1047 return false;
1048 }
1049 return normalized === '1'
1050 || normalized === 'true'
1051 || normalized === 'yes'
1052 || normalized === 'on';
1053}
1054
1055function loadRepoEnvDefaults() {
1056 const combined = {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected