change type to allow for proper defaults

This commit is contained in:
mierenmanz 2021-04-28 16:56:30 +02:00
parent 97298f17f8
commit 9c18ec2d1f

View file

@ -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<string, unknown> | null {
if (commandArgs === undefined) return null
const messageArgsNullableCopy: Array<string | null> = [...messageArgs]
const args: Record<string, unknown> = {}
for (const entry of commandArgs) {
switch (entry.match) {
case 'flag':