diff --git a/lib/decorators/api-extra-models.decorator.ts b/lib/decorators/api-extra-models.decorator.ts index 93e57f7cf..258c8d36e 100644 --- a/lib/decorators/api-extra-models.decorator.ts +++ b/lib/decorators/api-extra-models.decorator.ts @@ -7,7 +7,9 @@ export function ApiExtraModels(...models: Function[]) { descriptor?: TypedPropertyDescriptor ): any => { if (descriptor) { - const extraModels = Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, descriptor.value) || []; + const extraModels = + Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, descriptor.value) || + []; Reflect.defineMetadata( DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], @@ -16,7 +18,8 @@ export function ApiExtraModels(...models: Function[]) { return descriptor; } - const extraModels = Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, target) || []; + const extraModels = + Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, target) || []; Reflect.defineMetadata( DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], diff --git a/lib/decorators/api-property.decorator.ts b/lib/decorators/api-property.decorator.ts index 736b93357..0a30425f6 100644 --- a/lib/decorators/api-property.decorator.ts +++ b/lib/decorators/api-property.decorator.ts @@ -53,7 +53,7 @@ export function createApiPropertyDecorator( items: { type: options.type[0] } - } + }; } return createPropertyDecorator( diff --git a/lib/explorers/api-exclude-controller.explorer.ts b/lib/explorers/api-exclude-controller.explorer.ts index 9a380cc25..6ad785b3e 100644 --- a/lib/explorers/api-exclude-controller.explorer.ts +++ b/lib/explorers/api-exclude-controller.explorer.ts @@ -1,6 +1,6 @@ import { Type } from '@nestjs/common'; import { DECORATORS } from '../constants'; -export const exploreApiExcludeControllerMetadata = ( - metatype: Type -) => Reflect.getMetadata(DECORATORS.API_EXCLUDE_CONTROLLER, metatype)?.[0] === true; +export const exploreApiExcludeControllerMetadata = (metatype: Type) => + Reflect.getMetadata(DECORATORS.API_EXCLUDE_CONTROLLER, metatype)?.[0] === + true; diff --git a/lib/interfaces/swagger-custom-options.interface.ts b/lib/interfaces/swagger-custom-options.interface.ts index 6d51dd485..48cfe28a6 100644 --- a/lib/interfaces/swagger-custom-options.interface.ts +++ b/lib/interfaces/swagger-custom-options.interface.ts @@ -1,8 +1,9 @@ interface CommonSwaggerCustomOptions { - useGlobalPrefix?: boolean, + useGlobalPrefix?: boolean; } -export interface ExpressSwaggerCustomOptions extends CommonSwaggerCustomOptions { +export interface ExpressSwaggerCustomOptions + extends CommonSwaggerCustomOptions { explorer?: boolean; swaggerOptions?: Record; customCss?: string; @@ -16,7 +17,8 @@ export interface ExpressSwaggerCustomOptions extends CommonSwaggerCustomOptions urls?: Record<'url' | 'name', string>[]; } -export interface FastifySwaggerCustomOptions extends CommonSwaggerCustomOptions { +export interface FastifySwaggerCustomOptions + extends CommonSwaggerCustomOptions { uiConfig?: Partial<{ deepLinking: boolean; displayOperationId: boolean; diff --git a/lib/swagger-module.ts b/lib/swagger-module.ts index adbde890f..a7e1305cf 100644 --- a/lib/swagger-module.ts +++ b/lib/swagger-module.ts @@ -44,9 +44,9 @@ export class SwaggerModule { const httpAdapter = app.getHttpAdapter(); const globalPrefix = getGlobalPrefix(app); const finalPath = validatePath( - (options?.useGlobalPrefix && globalPrefix && !globalPrefix.match(/^(\/?)$/)) - ? `${globalPrefix}${validatePath(path)}` - : path + options?.useGlobalPrefix && globalPrefix && !globalPrefix.match(/^(\/?)$/) + ? `${globalPrefix}${validatePath(path)}` + : path ); if (httpAdapter && httpAdapter.getType() === 'fastify') { return this.setupFastify( diff --git a/lib/utils/get-global-prefix.ts b/lib/utils/get-global-prefix.ts index ff742023a..be8734b08 100644 --- a/lib/utils/get-global-prefix.ts +++ b/lib/utils/get-global-prefix.ts @@ -1,4 +1,4 @@ -import { INestApplication } from "@nestjs/common"; +import { INestApplication } from '@nestjs/common'; export function getGlobalPrefix(app: INestApplication): string { const internalConfigRef = (app as any).config;