refactor(artifacts): remove unused root classifier

This commit is contained in:
morluto
2026-10-10 04:16:29 +08:00
parent 7829b1aeef
commit 5291bca108
3 changed files with 9 additions and 19 deletions
-15
View File
@@ -28,21 +28,6 @@ const classifyContainerExtension = (
return undefined;
};
export const classifyRoot = async (
path: string,
directory: boolean,
): Promise<ArtifactOccurrence["artifact_format"]> => {
if (directory) return "directory";
const extensionFormat = classifyContainerExtension(path);
if (extensionFormat !== undefined) return extensionFormat;
const handle = await openRootFile(path);
try {
return await classifyOpenedRoot(path, handle);
} finally {
await handle.close();
}
};
/** Classify and hash one file root through the same stable open descriptor. */
export const classifyAndHashRoot = async (
path: string,
+1
View File
@@ -2,6 +2,7 @@ import { constants } from "node:fs";
import type { BigIntStats, Stats } from "node:fs";
import { open, type FileHandle } from "node:fs/promises";
/** Identifies a selected path that cannot be read as one regular file. */
export class NonRegularFileReadError extends Error {
readonly code: "EISDIR" | "ENOTFILE";