Add isTruthy helper

This commit is contained in:
Michael B. Gale committed 2026-02-28 16:32:30 +00:00
1 parent 898d46e783
commit efe64e03d9
1 file changed
+7
+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.
*/