diff --git a/archive/untar.ts b/archive/untar.ts index cd9b8c0cc..c89ae2d90 100644 --- a/archive/untar.ts +++ b/archive/untar.ts @@ -90,7 +90,6 @@ export interface TarEntry extends TarMetaWithLinkName {} /** Contains tar header metadata and a reader to the entry's body. */ export class TarEntry implements Reader { - #header: TarHeader; #reader: Reader | (Reader & Deno.Seeker); #size: number; #read = 0; @@ -100,11 +99,9 @@ export class TarEntry implements Reader { /** Constructs a new instance. */ constructor( meta: TarMetaWithLinkName, - header: TarHeader, reader: Reader | (Reader & Deno.Seeker), ) { Object.assign(this, meta); - this.#header = header; this.#reader = reader; // File Size @@ -327,7 +324,7 @@ export class Untar { const meta = this.#getMetadata(header); - this.#entry = new TarEntry(meta, header, this.reader); + this.#entry = new TarEntry(meta, this.reader); return this.#entry; } diff --git a/archive/untar_test.ts b/archive/untar_test.ts index 967811743..577d87cc1 100644 --- a/archive/untar_test.ts +++ b/archive/untar_test.ts @@ -2,12 +2,7 @@ import { assert, assertEquals, assertExists } from "@std/assert"; import { resolve } from "@std/path"; import { Tar, type TarMeta } from "./tar.ts"; -import { - TarEntry, - type TarHeader, - type TarMetaWithLinkName, - Untar, -} from "./untar.ts"; +import { TarEntry, type TarMetaWithLinkName, Untar } from "./untar.ts"; import { Buffer } from "@std/io/buffer"; import { copy } from "@std/io/copy"; import { readAll } from "@std/io/read-all"; @@ -323,26 +318,6 @@ Deno.test({ fn() { // test TarEntry class assertExists(TarEntry); - // Test TarEntry type - const bufSizes = [1, 53, 256, 511]; - const header: TarHeader = { - fileName: new Uint8Array(bufSizes), - fileMode: new Uint8Array(bufSizes), - uid: new Uint8Array(bufSizes), - gid: new Uint8Array(bufSizes), - fileSize: new Uint8Array(bufSizes), - mtime: new Uint8Array(bufSizes), - checksum: new Uint8Array(bufSizes), - type: new Uint8Array(bufSizes), - linkName: new Uint8Array(bufSizes), - ustar: new Uint8Array(bufSizes), - owner: new Uint8Array(bufSizes), - group: new Uint8Array(bufSizes), - majorNumber: new Uint8Array(bufSizes), - minorNumber: new Uint8Array(bufSizes), - fileNamePrefix: new Uint8Array(bufSizes), - padding: new Uint8Array(bufSizes), - }; const content = new TextEncoder().encode("hello tar world!"); const reader = new Buffer(content); const tarMeta = { @@ -356,7 +331,7 @@ Deno.test({ group: "deno", type: "directory", }; - const tarEntry: TarEntry = new TarEntry(tarMeta, header, reader); + const tarEntry: TarEntry = new TarEntry(tarMeta, reader); assertExists(tarEntry); }, });