Skip to content

Commit

Permalink
Merge pull request #1721 from andrewda/formatter
Browse files Browse the repository at this point in the history
style: format code
  • Loading branch information
kamilmysliwiec authored Dec 13, 2021
2 parents 8a0b01e + 56d1dc1 commit 4688f59
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
7 changes: 5 additions & 2 deletions lib/decorators/api-extra-models.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export function ApiExtraModels(...models: Function[]) {
descriptor?: TypedPropertyDescriptor<any>
): 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],
Expand All @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion lib/decorators/api-property.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function createApiPropertyDecorator(
items: {
type: options.type[0]
}
}
};
}

return createPropertyDecorator(
Expand Down
6 changes: 3 additions & 3 deletions lib/explorers/api-exclude-controller.explorer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type } from '@nestjs/common';
import { DECORATORS } from '../constants';

export const exploreApiExcludeControllerMetadata = (
metatype: Type<unknown>
) => Reflect.getMetadata(DECORATORS.API_EXCLUDE_CONTROLLER, metatype)?.[0] === true;
export const exploreApiExcludeControllerMetadata = (metatype: Type<unknown>) =>
Reflect.getMetadata(DECORATORS.API_EXCLUDE_CONTROLLER, metatype)?.[0] ===
true;
8 changes: 5 additions & 3 deletions lib/interfaces/swagger-custom-options.interface.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
interface CommonSwaggerCustomOptions {
useGlobalPrefix?: boolean,
useGlobalPrefix?: boolean;
}

export interface ExpressSwaggerCustomOptions extends CommonSwaggerCustomOptions {
export interface ExpressSwaggerCustomOptions
extends CommonSwaggerCustomOptions {
explorer?: boolean;
swaggerOptions?: Record<string, any>;
customCss?: string;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/swagger-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/get-global-prefix.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 4688f59

Please sign in to comment.