diff --git a/yarn-project/foundation/src/config/index.ts b/yarn-project/foundation/src/config/index.ts index 23b6a3bf6fc..2a31a008cc7 100644 --- a/yarn-project/foundation/src/config/index.ts +++ b/yarn-project/foundation/src/config/index.ts @@ -74,9 +74,11 @@ export function numberConfigHelper(defaultVal: number): Pick> { +): Required & { parseVal: (val: string) => boolean }> { + const parse = (val: string | boolean) => (typeof val === 'boolean' ? val : ['1', 'true', 'TRUE'].includes(val)); return { - parseEnv: (val: string) => ['1', 'true', 'TRUE'].includes(val), + parseEnv: parse, + parseVal: parse, defaultValue: defaultVal, isBoolean: true, };