Skip to content

Commit

Permalink
πŸ› fix(mini-cz): validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Feb 20, 2023
1 parent c74644b commit 442bcb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mini-cz/src/lib/commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 442bcb0

Please sign in to comment.