Skip to content

Commit 8831c9b

Browse files
committed
fix: fix ignore
1 parent 1ceb9d2 commit 8831c9b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/decompress.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "./deps.ts";
1414

1515
interface UntarOptions {
16-
ignore?: (entryName: string) => boolean;
16+
ignore?: (path: string) => boolean;
1717
normalize?(entry: TarEntry[]): TarEntry[];
1818
}
1919

@@ -31,10 +31,10 @@ export async function untar(
3131
}
3232
for (const entry of entrys) {
3333
const { fileName, type } = entry;
34-
if (options?.ignore && options?.ignore(fileName)) {
34+
const path = join(output, fileName);
35+
if (options?.ignore && options?.ignore(path)) {
3536
continue;
3637
}
37-
const path = join(output, fileName);
3838
if (type === "directory") {
3939
await ensureDir(path);
4040
paths.push(path);
@@ -50,7 +50,7 @@ export async function untar(
5050
}
5151

5252
interface UnzipOptions {
53-
ignore?: (entryName: string) => boolean;
53+
ignore?: (path: string) => boolean;
5454
/**
5555
* @default false
5656
*/
@@ -84,10 +84,10 @@ export async function unzip(
8484
);
8585

8686
const promises = newEntrys.map(async (entry) => {
87-
if (ignore(entry.filename)) {
87+
const path = join(output, entry.filename);
88+
if (ignore(path)) {
8889
return;
8990
}
90-
const path = join(output, entry.filename);
9191
paths.push(path);
9292
if (entry.directory) {
9393
await ensureDir(path);

0 commit comments

Comments
 (0)