@esportsplus/routing 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,6 @@ declare class Route<T> {
6
6
  responder: Next<T>;
7
7
  subdomain: string | null;
8
8
  constructor(responder: Next<T>);
9
- get dispatch(): (request: Request<T>) => T;
9
+ dispatch(request: Request<T>): T;
10
10
  }
11
11
  export { Route };
@@ -8,11 +8,11 @@ class Route {
8
8
  constructor(responder) {
9
9
  this.responder = responder;
10
10
  }
11
- get dispatch() {
11
+ dispatch(request) {
12
12
  if (this.middleware === null) {
13
- return (request) => this.responder(request);
13
+ return this.responder(request);
14
14
  }
15
- return pipeline(...this.middleware, (request) => this.responder(request));
15
+ return pipeline(...this.middleware, (request) => this.responder(request))(request);
16
16
  }
17
17
  }
18
18
  export { Route };
package/package.json CHANGED
@@ -17,5 +17,5 @@
17
17
  "prepublishOnly": "npm run build"
18
18
  },
19
19
  "types": "./build/index.d.ts",
20
- "version": "0.0.29"
20
+ "version": "0.0.30"
21
21
  }
@@ -15,12 +15,12 @@ class Route<T> {
15
15
  }
16
16
 
17
17
 
18
- get dispatch() {
18
+ dispatch(request: Request<T>) {
19
19
  if (this.middleware === null) {
20
- return (request: Request<T>) => this.responder(request);
20
+ return this.responder(request);
21
21
  }
22
22
 
23
- return pipeline(...this.middleware, (request) => this.responder(request));
23
+ return pipeline(...this.middleware, (request) => this.responder(request))(request);
24
24
  }
25
25
  }
26
26