From 031e339b9b2e3a36a8ba2e75b9d3028fa1b0d972 Mon Sep 17 00:00:00 2001 From: caohuilin Date: Fri, 13 Sep 2024 14:08:11 +0800 Subject: [PATCH] fix: unit test --- packages/toolkit/utils/src/cli/commands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/toolkit/utils/src/cli/commands.ts b/packages/toolkit/utils/src/cli/commands.ts index 63eb5a3a6b61..1b56f9d1ec3f 100644 --- a/packages/toolkit/utils/src/cli/commands.ts +++ b/packages/toolkit/utils/src/cli/commands.ts @@ -25,7 +25,7 @@ export const isDevCommand = () => { export const deprecatedCommands = ( program: Command & { commandsMap: Map }, ) => { - const lintCommand = program.commandsMap.get('lint'); + const lintCommand = program.commandsMap?.get('lint'); if (!lintCommand) { program .command('lint [...files]') @@ -37,7 +37,7 @@ export const deprecatedCommands = ( ); }); } - const preCommitCommand = program.commandsMap.get('pre-commit'); + const preCommitCommand = program.commandsMap?.get('pre-commit'); if (!preCommitCommand) { program .command('pre-commit')