From 409e71898dc3a3720c748d14dcc17605d10592a6 Mon Sep 17 00:00:00 2001 From: "Micael Levi L. Cavalcante" Date: Sat, 7 Sep 2024 18:36:12 -0400 Subject: [PATCH] style(core): fix formatting --- packages/core/discovery/discoverable-meta-host-collection.ts | 2 +- packages/core/injector/container.ts | 2 +- packages/core/inspector/serialized-graph.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/discovery/discoverable-meta-host-collection.ts b/packages/core/discovery/discoverable-meta-host-collection.ts index fd5c79dfaae..d4b55ac463e 100644 --- a/packages/core/discovery/discoverable-meta-host-collection.ts +++ b/packages/core/discovery/discoverable-meta-host-collection.ts @@ -146,7 +146,7 @@ export class DiscoverableMetaHostCollection { // But since calling `wrapper.instance` could degrade overall performance // we must defer it as much we can. instanceWrapper.metatype || instanceWrapper.inject - ? instanceWrapper.instance?.constructor ?? instanceWrapper.metatype + ? (instanceWrapper.instance?.constructor ?? instanceWrapper.metatype) : instanceWrapper.metatype, ); } diff --git a/packages/core/injector/container.ts b/packages/core/injector/container.ts index e9418a1b8a8..9fbbcbd8b66 100644 --- a/packages/core/injector/container.ts +++ b/packages/core/injector/container.ts @@ -313,7 +313,7 @@ export class NestContainer { metadataKey?: Exclude, ) { const metadata = this.dynamicModulesMetadata.get(token); - return metadataKey ? metadata?.[metadataKey] ?? [] : metadata; + return metadataKey ? (metadata?.[metadataKey] ?? []) : metadata; } public registerCoreModuleRef(moduleRef: Module) { diff --git a/packages/core/inspector/serialized-graph.ts b/packages/core/inspector/serialized-graph.ts index 9ba1b7d4cc8..241ef353d32 100644 --- a/packages/core/inspector/serialized-graph.ts +++ b/packages/core/inspector/serialized-graph.ts @@ -144,7 +144,7 @@ export class SerializedGraph { if (typeof value === 'symbol') { return value.toString(); } - return typeof value === 'function' ? value.name ?? 'Function' : value; + return typeof value === 'function' ? (value.name ?? 'Function') : value; }; return JSON.stringify(this.toJSON(), replacer, 2); }