From 2bf702eb9d8af7f94f5a1467c1ce2645ab1a2774 Mon Sep 17 00:00:00 2001 From: Sukairo-02 Date: Mon, 17 Jun 2024 16:10:07 +0300 Subject: [PATCH] Fixed lack of unrecognized option errors when options are undefined --- package.json | 2 +- src/command-core.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a77d4c3..fccc578 100644 --- a/package.json +++ b/package.json @@ -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, diff --git a/src/command-core.ts b/src/command-core.ts index 2774102..040eb50 100644 --- a/src/command-core.ts +++ b/src/command-core.ts @@ -291,9 +291,8 @@ const parseArg = (options: [string, GenericBuilderInternalsFields][], arg: strin const parseOptions = (command: Command, args: string[]): Record | undefined => { const options = command.options; - if (!options) return undefined; - const optEntries = Object.entries(options); + const optEntries = Object.entries(options ?? {} as Exclude); const result: Record = {};