Skip to content

Commit efe64e0

Browse files
committed
Add isTruthy helper
1 parent 898d46e commit efe64e0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pr-checks/sync.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ function writeYaml(filePath: string, data: any): void {
112112
fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
113113
}
114114

115+
function isTruthy(value: string | boolean | undefined): boolean {
116+
if (typeof value === "string") {
117+
return value.toLowerCase() === "true";
118+
}
119+
return Boolean(value);
120+
}
121+
115122
/**
116123
* Strip trailing whitespace from each line.
117124
*/

0 commit comments

Comments
 (0)