UNPKG

392 BJavaScriptView Raw
1'use strict';
2
3class KellnerRoute {
4 constructor(route) {
5 if (typeof route === 'string') {
6 this.path = route;
7 this.name = route;
8 } else {
9 if (!('path' in route))
10 throw new Error('KellnerRoute must have atleat a path');
11 this.path = route.path;
12 this.name = route.name || this.path;
13 }
14 }
15}
16
17KellnerRoute.rootRoute = new KellnerRoute('');
18
19module.exports = KellnerRoute;