-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(deno): use denoflate instead of compress (#1482)
deno.land/x/denoflate is about 10% smaller, and a lot more polished and up to date than deno.land/x/compress.
- Loading branch information
1 parent
01f0dd0
commit 2041f0a
Showing
2 changed files
with
4 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
declare module 'https://deno.land/x/[email protected]/mod.ts' { | ||
export interface InflateOptions { | ||
windowBits?: number; | ||
dictionary?: Uint8Array; | ||
chunkSize?: number; | ||
to?: string; | ||
raw?: boolean; | ||
} | ||
|
||
export function gunzip(input: Uint8Array, options?: InflateOptions): Uint8Array | ||
declare module "https://deno.land/x/[email protected]/mod.ts" { | ||
export function gunzip(input: Uint8Array): Uint8Array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import * as types from "../shared/types" | ||
import * as common from "../shared/common" | ||
import * as compress from "https://deno.land/x/[email protected]/mod.ts" | ||
import * as denoflate from "https://deno.land/x/[email protected]/mod.ts" | ||
|
||
declare const ESBUILD_VERSION: string | ||
|
||
|
@@ -108,7 +108,7 @@ function getCachePath(name: string): { finalPath: string, finalDir: string } { | |
|
||
function extractFileFromTarGzip(buffer: Uint8Array, file: string): Uint8Array { | ||
try { | ||
buffer = compress.gunzip(buffer) | ||
buffer = denoflate.gunzip(buffer) | ||
} catch (err) { | ||
throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`) | ||
} | ||
|