refactor: hide local check helpers

This commit is contained in:
Peter Steinberger
2026-05-02 08:30:46 +01:00
parent 636478c622
commit f2782c941e

View File

@@ -20,7 +20,7 @@ export function isLocalCheckEnabled(env) {
return raw !== "0" && raw !== "false";
}
export function isCiLikeEnv(env = process.env) {
function isCiLikeEnv(env = process.env) {
return env.CI === "true" || env.GITHUB_ACTIONS === "true";
}
@@ -35,7 +35,7 @@ export function resolveLocalHeavyCheckEnv(env = process.env) {
};
}
export function hasFlag(args, name) {
function hasFlag(args, name) {
return args.some((arg) => arg === name || arg.startsWith(`${name}=`));
}
@@ -161,7 +161,7 @@ export function shouldAcquireLocalHeavyCheckLockForTsgo(args, env = process.env)
);
}
export function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") {
function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") {
if (!isLocalCheckEnabled(env)) {
return false;
}
@@ -273,7 +273,7 @@ export function acquireLocalHeavyCheckLockSync(params) {
}
}
export function resolveGitCommonDir(cwd) {
function resolveGitCommonDir(cwd) {
const result = spawnSync("git", ["rev-parse", "--git-common-dir"], {
cwd,
encoding: "utf8",