feat: format scripts

This commit is contained in:
2025-01-19 09:52:07 +08:00
parent 2c37958f20
commit 1577eeb456

View File

@@ -1,4 +1,4 @@
export function compareVersion(ver1: string, ver2: string) { export function compareVersion(ver1: string, ver2: string): 0 | 1 | -1 {
if (ver1 === ver2) return 0; if (ver1 === ver2) return 0;
const ver1Parts = ver1.split("."); const ver1Parts = ver1.split(".");
const ver2Parts = ver2.split("."); const ver2Parts = ver2.split(".");
@@ -17,12 +17,12 @@ export function compareVersion(ver1: string, ver2: string) {
return 0; return 0;
} }
export function isOn(val: string) { export function isOn(val: string): boolean {
const lowerVal = (val == null) ? val : val.toLowerCase(); const lowerVal = (val == null) ? val : 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) { export function isEnvOn(envKey: string): string | undefined {
return Deno.env.get(envKey); return Deno.env.get(envKey);
} }