refactor: rename tar archive preflight checker

This commit is contained in:
Peter Steinberger
2026-03-10 23:52:51 +00:00
parent 6565ae1857
commit 9c64508822
2 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import { createHash } from "node:crypto";
import fs from "node:fs";
import {
createTarEntrySafetyChecker,
createTarEntryPreflightChecker,
extractArchive as extractArchiveSafe,
mergeExtractedTreeIntoDestination,
prepareArchiveDestinationDir,
@@ -102,7 +102,7 @@ export async function extractArchive(params: {
code: 1,
};
}
const checkTarEntrySafety = createTarEntrySafetyChecker({
const checkTarEntrySafety = createTarEntryPreflightChecker({
rootDir: destinationRealDir,
stripComponents: strip,
escapeLabel: "targetDir",

View File

@@ -505,7 +505,7 @@ function readTarEntryInfo(entry: unknown): TarEntryInfo {
return { path: p, type: t, size: s };
}
export function createTarEntrySafetyChecker(params: {
export function createTarEntryPreflightChecker(params: {
rootDir: string;
stripComponents?: number;
limits?: ArchiveExtractLimits;
@@ -570,7 +570,7 @@ export async function extractArchive(params: {
await withStagedArchiveDestination({
destinationRealDir,
run: async (stagingDir) => {
const checkTarEntrySafety = createTarEntrySafetyChecker({
const checkTarEntrySafety = createTarEntryPreflightChecker({
rootDir: destinationRealDir,
stripComponents: params.stripComponents,
limits,