refactor: hide command helper internals

This commit is contained in:
Peter Steinberger
2026-05-02 06:54:02 +01:00
parent fdbb2fdbc7
commit 52eee27f30
7 changed files with 10 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ export function normalizeCommandDescriptorName(name: string): string | null {
return SAFE_COMMAND_NAME_PATTERN.test(normalized) ? normalized : null;
}
export function assertSafeCommandDescriptorName(name: string): string {
function assertSafeCommandDescriptorName(name: string): string {
const normalized = normalizeCommandDescriptorName(name);
if (!normalized) {
throw new Error(`Invalid CLI command name: ${JSON.stringify(name.trim())}`);

View File

@@ -43,10 +43,7 @@ export function setCommandJsonMode(command: Command, mode: JsonMode): Command {
return command;
}
export function getCommandJsonMode(
command: Command,
argv: string[] = process.argv,
): JsonMode | null {
function getCommandJsonMode(command: Command, argv: string[] = process.argv): JsonMode | null {
if (!commandSelectedJsonFlag(command, argv)) {
return null;
}