Merge pull request #46 from mbahArip/v2

fix: `@typescript-eslint/prefer-nullish-coalescing` when building
This commit is contained in:
Arief Rachmawan
2025-04-30 09:52:29 +07:00
committed by GitHub
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -213,9 +213,7 @@ export async function GetReadme(id: string | null = null): Promise<
file = data.files[0];
} else {
file = data.files.find((file) => file.mimeType === "text/markdown");
if (!file) {
file = data.files.find((file) => file.mimeType === "application/vnd.google-apps.shortcut");
}
file ??= data.files.find((file) => file.mimeType === 'application/vnd.google-apps.shortcut');
}
if (!file)
+2 -2
View File
@@ -22,7 +22,7 @@ class EncryptionService {
const iv = crypto.getRandomValues(new Uint8Array(12));
const alg = { name: "AES-GCM", iv };
const keyhash = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(forceKey ? forceKey : this.key));
const keyhash = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(forceKey ?? this.key));
const encodedData = new TextEncoder().encode(data);
const secretKey = await crypto.subtle.importKey("raw", keyhash, alg, false, ["encrypt"]);
@@ -45,7 +45,7 @@ class EncryptionService {
if (!cipherText || !iv) throw new Error("Invalid hash format.");
const alg = { name: "AES-GCM", iv: new Uint8Array(Buffer.from(iv, "hex")) };
const keyhash = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(forceKey ? forceKey : this.key));
const keyhash = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(forceKey ?? this.key));
const secretKey = await crypto.subtle.importKey("raw", keyhash, alg, false, ["decrypt"]);