From a3915c88ea62d2af7b299a5fb2a11df600b423aa Mon Sep 17 00:00:00 2001 From: "Micael Levi L. Cavalcante" Date: Thu, 12 Oct 2023 20:55:16 -0400 Subject: [PATCH] style(core): fix formatting --- packages/core/middleware/routes-mapper.ts | 39 ++++++++++---------- packages/microservices/server/server-mqtt.ts | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/packages/core/middleware/routes-mapper.ts b/packages/core/middleware/routes-mapper.ts index 2600a9a720c..bd491277d89 100644 --- a/packages/core/middleware/routes-mapper.ts +++ b/packages/core/middleware/routes-mapper.ts @@ -87,28 +87,27 @@ export class RoutesMapper { version === VERSION_NEUTRAL ? undefined : version; const toRouteInfo = (item: RouteDefinition, prefix: string) => - item.path - ?.flatMap(p => { - let endpointPath = modulePath ?? ''; - endpointPath += this.normalizeGlobalPath(prefix) + addLeadingSlash(p); - - const routeInfo: RouteInfo = { - path: endpointPath, - method: item.requestMethod, - }; - const version = item.version ?? controllerVersion; - if (version && versioningConfig) { - if (typeof version !== 'string' && Array.isArray(version)) { - return version.map(v => ({ - ...routeInfo, - version: toUndefinedIfNeural(v), - })); - } - routeInfo.version = toUndefinedIfNeural(version); + item.path?.flatMap(p => { + let endpointPath = modulePath ?? ''; + endpointPath += this.normalizeGlobalPath(prefix) + addLeadingSlash(p); + + const routeInfo: RouteInfo = { + path: endpointPath, + method: item.requestMethod, + }; + const version = item.version ?? controllerVersion; + if (version && versioningConfig) { + if (typeof version !== 'string' && Array.isArray(version)) { + return version.map(v => ({ + ...routeInfo, + version: toUndefinedIfNeural(v), + })); } + routeInfo.version = toUndefinedIfNeural(version); + } - return routeInfo; - }); + return routeInfo; + }); return [] .concat(routePath) diff --git a/packages/microservices/server/server-mqtt.ts b/packages/microservices/server/server-mqtt.ts index b40dd74e00a..8e6ff3b8357 100644 --- a/packages/microservices/server/server-mqtt.ts +++ b/packages/microservices/server/server-mqtt.ts @@ -189,7 +189,7 @@ export class ServerMqtt extends Server implements CustomTransportStrategy { if (this.messageHandlers.has(route)) { return this.messageHandlers.get(route) || null; } - + for (const [key, value] of this.messageHandlers) { const keyWithoutSharedPrefix = this.removeHandlerKeySharedPrefix(key); if (this.matchMqttPattern(keyWithoutSharedPrefix, route)) {