We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c38149 commit 28f46ffCopy full SHA for 28f46ff
packages/event-handler/src/rest/RouteHandlerRegistry.ts
@@ -30,11 +30,9 @@ class RouteHandlerRegistry {
30
31
this.#routes.set(route.id, route);
32
33
- if (!this.#routesByMethod.has(route.method)) {
34
- this.#routesByMethod.set(route.method, []);
35
- }
36
- // biome-ignore lint/style/noNonNullAssertion: Map.set operation above ensures Map.get won't return undefined
37
- this.#routesByMethod.get(route.method)!.push(route);
+ const routesByMethod = this.#routesByMethod.get(route.method) ?? [];
+ routesByMethod.push(route);
+ this.#routesByMethod.set(route.method, routesByMethod);
38
}
39
40
public getRouteCount(): number {
0 commit comments