From 442bcb0f6cefe98672b08faccce1dfcd86dc1e29 Mon Sep 17 00:00:00 2001 From: so1ve Date: Mon, 20 Feb 2023 16:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(mini-cz):=20validation=20log?= =?UTF-8?q?ic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mini-cz/src/lib/commit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mini-cz/src/lib/commit.ts b/packages/mini-cz/src/lib/commit.ts index ed0ba4c..424a79e 100644 --- a/packages/mini-cz/src/lib/commit.ts +++ b/packages/mini-cz/src/lib/commit.ts @@ -86,7 +86,7 @@ export const commit = async ( await promptKind(); } const kindNames = config.kinds.map(({ name }) => name); - if (!kindNames.includes(kind!)) { + if (kind && !kindNames.includes(kind)) { kons.error("Invalid kind."); await promptKind(); } @@ -122,7 +122,7 @@ export const commit = async ( await promptScope(); } - if (config.scopes?.length && !config.scopes.includes(scope!)) { + if (config.scopes?.length && scope && !config.scopes.includes(scope)) { kons.error("Invalid scope."); await promptScope(); }