This can be simplified:

```js
if (typeof route === 'function') {
  route = new route();
}
addRoute(route, router);
```