feat: format scripts
This commit is contained in:
@@ -17,12 +17,15 @@ export function compareVersion(ver1: string, ver2: string): 0 | 1 | -1 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function isOn(val: string): boolean {
|
||||
const lowerVal = (val == null) ? val : val.toLowerCase();
|
||||
export function isOn(val: string | undefined): boolean {
|
||||
if ((val === null) || (val === undefined)) {
|
||||
return false;
|
||||
}
|
||||
const lowerVal = val.toLowerCase();
|
||||
return lowerVal === "on" || lowerVal === "yes" || lowerVal === "1" ||
|
||||
lowerVal === "true";
|
||||
}
|
||||
|
||||
export function isEnvOn(envKey: string): string | undefined {
|
||||
return Deno.env.get(envKey);
|
||||
export function isEnvOn(envKey: string): boolean {
|
||||
return isOn(Deno.env.get(envKey));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user