Add raw command shorthand
This commit is contained in:
parent
6d55ce8a2d
commit
e5c5938414
File diff suppressed because one or more lines are too long
@ -183,7 +183,10 @@ export default createCommandMiddleware(COMMAND, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
[notFoundHandler](_, command) {
|
[notFoundHandler](ctx, command, ...params) {
|
||||||
|
if (command === command.toUpperCase()) {
|
||||||
|
return this.raw(ctx, command, ...params);
|
||||||
|
}
|
||||||
return error(`=> /${command}: No such command`);
|
return error(`=> /${command}: No such command`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ export default function createCommandMiddleware(type, handlers) {
|
|||||||
process(ctx, handlers[command](ctx, ...params));
|
process(ctx, handlers[command](ctx, ...params));
|
||||||
} else if (notFoundHandler in handlers) {
|
} else if (notFoundHandler in handlers) {
|
||||||
const ctx = createContext(store, action);
|
const ctx = createContext(store, action);
|
||||||
process(ctx, handlers[notFoundHandler](ctx, command));
|
process(ctx, handlers[notFoundHandler](ctx, command, ...params));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user