первй коммит
This commit is contained in:
@@ -4,6 +4,7 @@ export class ProjectLimitsPolicy {
|
||||
this.hardFileLimit = 10000;
|
||||
this.softSizeLimitBytes = 1 * 1024 * 1024;
|
||||
this.hardSizeLimitBytes = 10 * 1024 * 1024;
|
||||
this.ignoredDirectoryNames = new Set(["app-data", "build", "grafana", "__pycache__"]);
|
||||
}
|
||||
|
||||
summarizeFileList(fileList) {
|
||||
@@ -12,7 +13,7 @@ export class ProjectLimitsPolicy {
|
||||
|
||||
for (const file of fileList) {
|
||||
const relPath = (file.webkitRelativePath || file.name || "").replaceAll("\\", "/");
|
||||
if (this.#isHiddenPath(relPath)) continue;
|
||||
if (this.#isIgnoredPath(relPath)) continue;
|
||||
totalFiles += 1;
|
||||
totalBytes += Number(file.size || 0);
|
||||
}
|
||||
@@ -43,11 +44,11 @@ export class ProjectLimitsPolicy {
|
||||
return { softWarnings, hardErrors };
|
||||
}
|
||||
|
||||
#isHiddenPath(path) {
|
||||
#isIgnoredPath(path) {
|
||||
const parts = String(path || "")
|
||||
.split("/")
|
||||
.filter(Boolean);
|
||||
return parts.some((segment) => segment.startsWith("."));
|
||||
return parts.some((segment) => segment.startsWith(".") || this.ignoredDirectoryNames.has(segment));
|
||||
}
|
||||
|
||||
#formatBytes(bytes) {
|
||||
|
||||
Reference in New Issue
Block a user