Commit772a24funknown_key
fix(types): resolve BufferSource typing in 4 files (6 errors cleared)
fix(types): resolve BufferSource typing in 4 files (6 errors cleared) Pure type-cast fixes preserving runtime — Uint8Array now requires explicit BufferSource coercion at crypto.subtle call sites (newer lib.dom.d.ts). Response body likewise needs BodyInit cast for Uint8Array inputs. No runtime change. Same class as form-method casing precedent — LOCKED files permitted under pure-annotation rule. https://claude.ai/code/session_0155D2jj2kJXaMEnyJhRpRLg
4 files changed+6−6772a24f821709cfc76fd1da41cc77c76d030f028
4 changed files+6−6
Modifiedsrc/lib/signatures.ts+2−2View fileUnifiedSplit
@@ -356,7 +356,7 @@ export async function fingerprintForPublicKey(
356356 } catch {
357357 return null;
358358 }
359 const digest = await crypto.subtle.digest("SHA-256", bytes);
359 const digest = await crypto.subtle.digest("SHA-256", bytes as BufferSource);
360360 // Base64 (unpadded) — mimics `ssh-keygen -l -E sha256`.
361361 const b64 = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(
362362 /=+$/,
@@ -422,7 +422,7 @@ export function analyzeRawCommit(
422422}
423423
424424async function fingerprintSshBytes(bytes: Uint8Array): Promise<string> {
425 const digest = await crypto.subtle.digest("SHA-256", bytes);
425 const digest = await crypto.subtle.digest("SHA-256", bytes as BufferSource);
426426 const b64 = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(
427427 /=+$/,
428428 ""
Modifiedsrc/lib/totp.ts+2−2View fileUnifiedSplit
@@ -68,12 +68,12 @@ async function hmacSha1(
6868): Promise<Uint8Array> {
6969 const key = await crypto.subtle.importKey(
7070 "raw",
71 keyBytes,
71 keyBytes as BufferSource,
7272 { name: "HMAC", hash: "SHA-1" },
7373 false,
7474 ["sign"]
7575 );
76 const sig = await crypto.subtle.sign("HMAC", key, msgBytes);
76 const sig = await crypto.subtle.sign("HMAC", key, msgBytes as BufferSource);
7777 return new Uint8Array(sig);
7878}
7979
Modifiedsrc/routes/pages.tsx+1−1View fileUnifiedSplit
@@ -168,7 +168,7 @@ pagesRoute.get("/:owner/:repo/pages/*", async (c) => {
168168 candidate
169169 );
170170 if (!raw) continue;
171 return new Response(raw, { status: 200, headers });
171 return new Response(raw as BodyInit, { status: 200, headers });
172172 }
173173
174174 return new Response(blob.content, { status: 200, headers });
Modifiedsrc/routes/web.tsx+1−1View fileUnifiedSplit
@@ -1052,7 +1052,7 @@ web.get("/:owner/:repo/raw/:ref{.+$}", async (c) => {
10521052 if (!data) return c.text("Not found", 404);
10531053
10541054 const fileName = filePath.split("/").pop() || "file";
1055 return new Response(data, {
1055 return new Response(data as BodyInit, {
10561056 headers: {
10571057 "Content-Type": "application/octet-stream",
10581058 "Content-Disposition": `attachment; filename="${fileName}"`,
10591059