@iconify/tools 5.0.0-beta.3 → 5.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,6 @@ import { GitHubAPIOptions } from "./types.js";
|
|
|
5
5
|
import { UnzipFilterCallback } from "../helpers/unzip.js";
|
|
6
6
|
interface IfModifiedSinceOption {
|
|
7
7
|
ifModifiedSince: string | DownloadGitHubRepoResult;
|
|
8
|
-
filter?: UnzipFilterCallback;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Options for downloadGitHubRepo()
|
|
@@ -14,6 +13,7 @@ interface DownloadGitHubRepoOptions extends ExportTargetOptions, GitHubAPIOption
|
|
|
14
13
|
cleanupOldFiles?: boolean;
|
|
15
14
|
cleanupOldDirectories?: boolean;
|
|
16
15
|
log?: boolean;
|
|
16
|
+
filter?: UnzipFilterCallback;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Result
|
|
@@ -5,7 +5,6 @@ import { UnzipFilterCallback } from "../helpers/unzip.js";
|
|
|
5
5
|
import { GitLabAPIOptions } from "./types.js";
|
|
6
6
|
interface IfModifiedSinceOption {
|
|
7
7
|
ifModifiedSince: string | DownloadGitLabRepoResult;
|
|
8
|
-
filter?: UnzipFilterCallback;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
10
|
* Options for downloadGitLabRepo()
|
|
@@ -14,6 +13,7 @@ interface DownloadGitLabRepoOptions extends ExportTargetOptions, GitLabAPIOption
|
|
|
14
13
|
cleanupOldFiles?: boolean;
|
|
15
14
|
cleanupOldDirectories?: boolean;
|
|
16
15
|
log?: boolean;
|
|
16
|
+
filter?: UnzipFilterCallback;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Result
|
|
@@ -13,7 +13,7 @@ async function unzip(source, path, filter) {
|
|
|
13
13
|
for (const name in data$1) {
|
|
14
14
|
const filePath = normalize(join(dir, name));
|
|
15
15
|
if (filter && !filter(filePath)) continue;
|
|
16
|
-
if (filePath.startsWith("/") || filePath.includes("
|
|
16
|
+
if (filePath.startsWith("/") || filePath.includes("../") || filePath.includes(":")) throw new Error("Invalid file path in zip: " + filePath);
|
|
17
17
|
if (filePath.includes("/._")) continue;
|
|
18
18
|
const isDir = filePath.endsWith("/");
|
|
19
19
|
const fileDir = isDir ? filePath.slice(0, filePath.length - 1) : dirname(filePath);
|
package/package.json
CHANGED