Fix route CLI commands
This commit is contained in:
@@ -17,9 +17,14 @@ export class RoutesDirective extends Directive {
|
||||
}
|
||||
|
||||
async handle(): Promise<void> {
|
||||
/* const maxRouteLength = this.routing.getCompiled().max(route => String(route).length)
|
||||
const maxHandlerLength = this.routing.getCompiled().max(route => route.getDisplayableHandler().length)
|
||||
const rows = this.routing.getCompiled().map<[string, string]>(route => [String(route), route.getDisplayableHandler()])
|
||||
const compiled = this.routing.getCompiled()
|
||||
|
||||
const maxRouteLength = compiled.strings().max('length')
|
||||
const maxHandlerLength = compiled.mapCall('getHandlerDisplay')
|
||||
.whereDefined()
|
||||
.max('length')
|
||||
|
||||
const rows = compiled.map(route => [String(route), route.getHandlerDisplay()])
|
||||
|
||||
const table = new Table({
|
||||
head: ['Route', 'Handler'],
|
||||
@@ -28,6 +33,6 @@ export class RoutesDirective extends Directive {
|
||||
|
||||
table.push(...rows.toArray())
|
||||
|
||||
this.info('\n' + table)*/
|
||||
this.info('\n' + table)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user