Replace typescript compiler with native tsgo compiler

This commit is contained in:
Jamie
2026-03-18 11:26:18 -07:00
committed by GitHub
parent 5e6af4708b
commit c90ca2b4e0
207 changed files with 1819 additions and 1270 deletions

View File

@@ -69,7 +69,7 @@ export type LinkPreviewMetadata = {
};
export type LinkPreviewImage = {
data: Uint8Array;
data: Uint8Array<ArrayBuffer>;
contentType: MIMEType;
};
@@ -228,7 +228,7 @@ const emptyHtmlDocument = (): HTMLDocument =>
// (This fallback could, perhaps, be smarter based on user locale.)
// [0]: https://www.w3.org/International/questions/qa-html-encoding-declarations.en
const parseHtmlBytes = (
bytes: Readonly<Uint8Array>,
bytes: Readonly<Uint8Array<ArrayBuffer>>,
httpCharset: string | null
): HTMLDocument => {
const hasBom = bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf;
@@ -288,7 +288,7 @@ const parseHtmlBytes = (
};
const getHtmlDocument = async (
body: AsyncIterable<string | Uint8Array>,
body: AsyncIterable<string | Uint8Array<ArrayBuffer>>,
httpCharset: string | null,
abortSignal: AbortSignal,
logger: Pick<LoggerType, 'warn'> = log
@@ -522,6 +522,7 @@ export async function fetchLinkPreviewMetadata(
}
const document = await getHtmlDocument(
// @ts-expect-error ReadableStream should actually be giving us ArrayBuffers
response.body,
contentType.charset,
abortSignal,
@@ -614,7 +615,7 @@ async function processImageResponse(
return null;
}
let data: Uint8Array;
let data: Uint8Array<ArrayBuffer>;
try {
data = await response.buffer();
} catch (err) {