Skip to content

Commit

Permalink
Fixed lack of unrecognized option errors when options are undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukairo-02 committed Jun 17, 2024
1 parent b8532c1 commit 2bf702e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@drizzle-team/brocli",
"type": "module",
"author": "Drizzle Team",
"version": "0.0.3",
"version": "0.0.4",
"description": "Typed CLI command runner",
"license": "Apache-2.0",
"sideEffects": false,
Expand Down
3 changes: 1 addition & 2 deletions src/command-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,8 @@ const parseArg = (options: [string, GenericBuilderInternalsFields][], arg: strin

const parseOptions = (command: Command, args: string[]): Record<string, OutputType> | undefined => {
const options = command.options;
if (!options) return undefined;

const optEntries = Object.entries(options);
const optEntries = Object.entries(options ?? {} as Exclude<typeof options, undefined>);

const result: Record<string, OutputType> = {};

Expand Down

0 comments on commit 2bf702e

Please sign in to comment.