mirror of
https://github.com/github/codeql-action
synced 2026-05-23 20:00:54 +03:00
Add isTruthy helper
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user