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