mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:30:42 +00:00
refactor: hide command helper internals
This commit is contained in:
@@ -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())}`);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user