Add isTruthy helper

This commit is contained in:
Michael B. Gale
2026-02-28 16:18:53 +00:00
parent 898d46e783
commit efe64e03d9
+7
View File
@@ -112,6 +112,13 @@ function writeYaml(filePath: string, data: any): void {
fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
}
function isTruthy(value: string | boolean | undefined): boolean {
if (typeof value === "string") {
return value.toLowerCase() === "true";
}
return Boolean(value);
}
/**
* Strip trailing whitespace from each line.
*/