mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-10-23 09:22:24 +00:00
Interning a sub-command would overwrite the parent command.
This commit is contained in:
1 parent
c2f185cf92
commit
ddba23f323
1 file changed
+3
-2
@@ -91,8 +91,9 @@ export class CommandTable<ExecutorType extends BaseFunction> {
|
||||
if (table.next === undefined) {
|
||||
table.next = new Map();
|
||||
}
|
||||
const nextLookupEntry = {};
|
||||
table.next!.set(designator.shift()!, nextLookupEntry);
|
||||
const currentDesignator = designator.shift()!;
|
||||
const nextLookupEntry = table.next.get(currentDesignator)
|
||||
?? ((lookup: CommandLookupEntry<ExecutorType>) => (table.next?.set(currentDesignator, lookup), lookup))({});
|
||||
internCommandHelper(nextLookupEntry, designator);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user