From 9c18ec2d1f0ad8c9b3f8f0b4e20d29e87fc92708 Mon Sep 17 00:00:00 2001 From: mierenmanz Date: Wed, 28 Apr 2021 16:56:30 +0200 Subject: [PATCH] change type to allow for proper defaults --- src/utils/command.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/command.ts b/src/utils/command.ts index 3cfa939..713857e 100644 --- a/src/utils/command.ts +++ b/src/utils/command.ts @@ -6,7 +6,7 @@ export interface Args { match: CommandArgumentMatchTypes // Still needs to be implemented // type?: unknown - defaultValue?: string + defaultValue?: unknown flag?: string } @@ -15,8 +15,10 @@ export function parseArgs( messageArgs: string[] ): Record | null { if (commandArgs === undefined) return null + const messageArgsNullableCopy: Array = [...messageArgs] const args: Record = {} + for (const entry of commandArgs) { switch (entry.match) { case 'flag':