added parameter type choice error

This commit is contained in:
mmacierzanka committed 2021-08-27 14:32:14 +02:00
1 parent a8efeae9cc
commit 2537261e80
2 files changed
+7 -1

No files matched your search

+6
View File
@@ -64,6 +64,12 @@ export class CommandManager {
ar.splice(i, 1);
}
});
command.parameters &&
command.parameters.map((p) => {
if (p.type != "string" && p.choices) {
throw new Error('Parameter with defined choices must have a "string" type');
}
});
this.list.push(command);
return true;
} catch (e) {