Skip to content

Commit

Permalink
fix(express): throw an error if Router.Children are defined without R…
Browse files Browse the repository at this point in the history
…outer
  • Loading branch information
jeremyben committed Oct 3, 2021
1 parent c68bca8 commit da7a357
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions express/src/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ function registerRouter(

// Recursively attach children routers
if (routerMeta?.children) {
if (routerMeta.path == null) {
throw Error(`"${routerClass.name}" must be decorated with @Router.`)
}

// Keep track of all shared middlewares for dedupe.
const parentSharedMwares_ = parentSharedMwares.concat(sharedMwares)

Expand Down

0 comments on commit da7a357

Please sign in to comment.