js: cleanup error throwing to always use new Error (#504)

This commit is contained in:
Brandon Liu
2024-12-13 14:42:13 +08:00
committed by GitHub
parent 7ed6377031
commit 5b075048cc
4 changed files with 14 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ async function nativeDecompress(
const result = stream?.pipeThrough(new DecompressionStream("gzip"));
return new Response(result).arrayBuffer();
}
throw Error("Compression method not supported");
throw new Error("Compression method not supported");
}
const CACHE = new ResolvedValueCache(25, undefined, nativeDecompress);