refactor: dedupe tooling helpers

This commit is contained in:
Peter Steinberger
2026-04-23 18:06:49 +01:00
parent f98f93c29a
commit 2045c0977e
11 changed files with 244 additions and 347 deletions

View File

@@ -1,6 +1,7 @@
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { readFlagValue } from "./arg-utils.mjs";
const CORE_TEST_CONFIGS = new Set([
"tsconfig.core.test.json",
@@ -73,16 +74,3 @@ function isMetadataOnlyCommand(args) {
["--help", "-h", "--version", "-v", "--init", "--showConfig"].includes(arg),
);
}
function readFlagValue(args, name) {
for (let index = 0; index < args.length; index++) {
const arg = args[index];
if (arg === name) {
return args[index + 1];
}
if (arg.startsWith(`${name}=`)) {
return arg.slice(name.length + 1);
}
}
return undefined;
}