src/router.ts
Function constructor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
const handler = (path: any, ...callbacks: any): void => {
const flattened = [].concat(...callbacks); // flatten array
if (typeof path === 'string' && flattened.every((cb: any) => typeof cb === 'function')) {
flattened.forEach((cb: any) => cb(this.request, this.response, this.next));