Skip to content

Commit

Permalink
style(core): fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Oct 13, 2023
1 parent 1747683 commit a3915c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
39 changes: 19 additions & 20 deletions packages/core/middleware/routes-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/microservices/server/server-mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit a3915c8

Please sign in to comment.