Skip to content

Commit

Permalink
[chore] add sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-wyatt committed Jul 16, 2018
1 parent 624a339 commit 5278424
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/RouterSpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ export class RouterSpool extends SystemSpool {
.filter(route => !!route)
.sort(Utils.createSpecificityComparator({ order: this.app.config.get('router.sortOrder') }))
}

sanity () {
if (!Array.isArray(this.app.routes)) {
throw new Error('Sanity Failed: app.routes is not an array!')
}
}
}

0 comments on commit 5278424

Please sign in to comment.