Skip to content

Commit

Permalink
fix: no need to decompress buffer when downloading functions
Browse files Browse the repository at this point in the history
  • Loading branch information
laktek committed Oct 26, 2023
1 parent 7f64b4e commit f11ba7c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/utils/denos/extract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as path from "https://deno.land/[email protected]/path/mod.ts";
import { readAll } from "https://deno.land/[email protected]/streams/conversion.ts";
import { decompress } from "https://deno.land/x/[email protected]/mod.ts";
import { Parser } from "https://deno.land/x/[email protected]/mod.ts";

async function write(p: string, content: string) {
Expand All @@ -19,7 +18,7 @@ async function extractEszip(
destPath: string,
entrypointUrl: string,
parser: Parser,
specifiers: string[]
specifiers: string[],
) {
const entrypointPath = path.fromFileUrl(entrypointUrl);
const basePath = path.dirname(entrypointPath);
Expand All @@ -40,9 +39,8 @@ async function extractEszip(

async function extractSource(destPath: string, entrypointUrl: string) {
const buf = await readAll(Deno.stdin);
// response is compressed with Brotli
const decompressed = decompress(buf);
const { parser, specifiers } = await loadEszip(decompressed);

const { parser, specifiers } = await loadEszip(buf);
await extractEszip(destPath, entrypointUrl, parser, specifiers);
}

Expand Down

0 comments on commit f11ba7c

Please sign in to comment.