mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 15:08:37 +00:00
chore: update prettier
This commit is contained in:
@@ -12,9 +12,10 @@ export interface Response<T> {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class TransformInterceptor<T>
|
||||
implements NestInterceptor<T, Response<T>>
|
||||
{
|
||||
export class TransformInterceptor<T> implements NestInterceptor<
|
||||
T,
|
||||
Response<T>
|
||||
> {
|
||||
intercept(
|
||||
context: ExecutionContext,
|
||||
next: CallHandler<T>,
|
||||
|
||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -118,7 +118,7 @@
|
||||
"nats": "2.29.3",
|
||||
"nodemon": "3.1.11",
|
||||
"nyc": "14.1.1",
|
||||
"prettier": "3.6.2",
|
||||
"prettier": "^3.7.4",
|
||||
"redis": "5.10.0",
|
||||
"rxjs-compat": "6.6.7",
|
||||
"sinon": "21.0.0",
|
||||
@@ -33991,10 +33991,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
|
||||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz",
|
||||
"integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
"nats": "2.29.3",
|
||||
"nodemon": "3.1.11",
|
||||
"nyc": "14.1.1",
|
||||
"prettier": "3.6.2",
|
||||
"prettier": "^3.7.4",
|
||||
"redis": "5.10.0",
|
||||
"rxjs-compat": "6.6.7",
|
||||
"sinon": "21.0.0",
|
||||
|
||||
@@ -17,8 +17,9 @@ import { WebSocketAdapter } from './websockets/web-socket-adapter.interface';
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface INestApplication<TServer = any>
|
||||
extends INestApplicationContext {
|
||||
export interface INestApplication<
|
||||
TServer = any,
|
||||
> extends INestApplicationContext {
|
||||
/**
|
||||
* A wrapper function around HTTP adapter method: `adapter.use()`.
|
||||
* Example `app.use(cors())`
|
||||
|
||||
@@ -53,8 +53,8 @@ export interface ConfigurableModuleBuilderOptions {
|
||||
export class ConfigurableModuleBuilder<
|
||||
ModuleOptions,
|
||||
StaticMethodKey extends string = typeof DEFAULT_METHOD_KEY,
|
||||
FactoryClassMethodKey extends
|
||||
string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
FactoryClassMethodKey extends string =
|
||||
typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
ExtraModuleDefinitionOptions = {},
|
||||
> {
|
||||
protected staticMethodKey: StaticMethodKey;
|
||||
|
||||
@@ -28,8 +28,8 @@ export type ConfigurableModuleOptionsFactory<
|
||||
*/
|
||||
export interface ConfigurableModuleAsyncOptions<
|
||||
ModuleOptions,
|
||||
FactoryClassMethodKey extends
|
||||
string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
FactoryClassMethodKey extends string =
|
||||
typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
> extends Pick<ModuleMetadata, 'imports'> {
|
||||
/**
|
||||
* Injection token resolving to an existing provider. The provider must implement
|
||||
|
||||
@@ -16,8 +16,8 @@ import { ConfigurableModuleAsyncOptions } from './configurable-module-async-opti
|
||||
export type ConfigurableModuleCls<
|
||||
ModuleOptions,
|
||||
MethodKey extends string = typeof DEFAULT_METHOD_KEY,
|
||||
FactoryClassMethodKey extends
|
||||
string = typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
FactoryClassMethodKey extends string =
|
||||
typeof DEFAULT_FACTORY_CLASS_METHOD_KEY,
|
||||
ExtraModuleDefinitionOptions = {},
|
||||
> = {
|
||||
new (): any;
|
||||
|
||||
@@ -13,9 +13,10 @@ import { isNil, isNumber } from '../utils/shared.utils';
|
||||
* @publicApi
|
||||
*/
|
||||
@Injectable()
|
||||
export class DefaultValuePipe<T = any, R = any>
|
||||
implements PipeTransform<T, T | R>
|
||||
{
|
||||
export class DefaultValuePipe<T = any, R = any> implements PipeTransform<
|
||||
T,
|
||||
T | R
|
||||
> {
|
||||
constructor(protected readonly defaultValue: R) {}
|
||||
|
||||
transform(value?: T, _metadata?: ArgumentMetadata): T | R {
|
||||
|
||||
@@ -16,11 +16,10 @@ const DEFAULT_ARRAY_SEPARATOR = ',';
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ParseArrayOptions
|
||||
extends Omit<
|
||||
ValidationPipeOptions,
|
||||
'transform' | 'validateCustomDecorators' | 'exceptionFactory'
|
||||
> {
|
||||
export interface ParseArrayOptions extends Omit<
|
||||
ValidationPipeOptions,
|
||||
'transform' | 'validateCustomDecorators' | 'exceptionFactory'
|
||||
> {
|
||||
/**
|
||||
* Type for items to be converted into
|
||||
*/
|
||||
|
||||
@@ -41,9 +41,10 @@ export interface ParseBoolPipeOptions {
|
||||
* @publicApi
|
||||
*/
|
||||
@Injectable()
|
||||
export class ParseBoolPipe
|
||||
implements PipeTransform<string | boolean, Promise<boolean>>
|
||||
{
|
||||
export class ParseBoolPipe implements PipeTransform<
|
||||
string | boolean,
|
||||
Promise<boolean>
|
||||
> {
|
||||
protected exceptionFactory: (error: string) => any;
|
||||
|
||||
constructor(@Optional() protected readonly options?: ParseBoolPipeOptions) {
|
||||
|
||||
@@ -31,9 +31,9 @@ export interface ParseDatePipeOptions {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class ParseDatePipe
|
||||
implements PipeTransform<string | number | undefined | null>
|
||||
{
|
||||
export class ParseDatePipe implements PipeTransform<
|
||||
string | number | undefined | null
|
||||
> {
|
||||
protected exceptionFactory: (error: string) => any;
|
||||
|
||||
constructor(private readonly options: ParseDatePipeOptions = {}) {
|
||||
|
||||
@@ -24,8 +24,7 @@ const REFLECTOR = 'Reflector';
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ClassSerializerInterceptorOptions
|
||||
extends ClassTransformOptions {
|
||||
export interface ClassSerializerInterceptorOptions extends ClassTransformOptions {
|
||||
transformerPackage?: TransformerPackage;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
import { expect } from 'chai';
|
||||
import { Type } from '../../../common';
|
||||
import {
|
||||
|
||||
@@ -9,8 +9,7 @@ export abstract class AbstractHttpAdapter<
|
||||
TServer = any,
|
||||
TRequest = any,
|
||||
TResponse = any,
|
||||
> implements HttpServer<TRequest, TResponse>
|
||||
{
|
||||
> implements HttpServer<TRequest, TResponse> {
|
||||
protected httpServer: TServer;
|
||||
protected onRouteTriggered:
|
||||
| ((requestMethod: RequestMethod, path: string) => void)
|
||||
|
||||
@@ -7,9 +7,7 @@ import { ModuleOpaqueKeyFactory } from './interfaces/module-opaque-key-factory.i
|
||||
|
||||
const K_MODULE_ID = Symbol('K_MODULE_ID');
|
||||
|
||||
export class ByReferenceModuleOpaqueKeyFactory
|
||||
implements ModuleOpaqueKeyFactory
|
||||
{
|
||||
export class ByReferenceModuleOpaqueKeyFactory implements ModuleOpaqueKeyFactory {
|
||||
private readonly keyGenerationStrategy: 'random' | 'shallow';
|
||||
|
||||
constructor(options?: { keyGenerationStrategy: 'random' | 'shallow' }) {
|
||||
|
||||
@@ -10,9 +10,7 @@ import { ModuleOpaqueKeyFactory } from './interfaces/module-opaque-key-factory.i
|
||||
const CLASS_STR = 'class ';
|
||||
const CLASS_STR_LEN = CLASS_STR.length;
|
||||
|
||||
export class DeepHashedModuleOpaqueKeyFactory
|
||||
implements ModuleOpaqueKeyFactory
|
||||
{
|
||||
export class DeepHashedModuleOpaqueKeyFactory implements ModuleOpaqueKeyFactory {
|
||||
private readonly moduleIdsCache = new WeakMap<Type<unknown>, string>();
|
||||
private readonly moduleTokenCache = new Map<string, string>();
|
||||
private readonly logger = new Logger(DeepHashedModuleOpaqueKeyFactory.name, {
|
||||
|
||||
@@ -33,8 +33,8 @@ import { RouteInfoPathExtractor } from './route-info-path-extractor';
|
||||
import { RoutesMapper } from './routes-mapper';
|
||||
|
||||
export class MiddlewareModule<
|
||||
TAppOptions extends
|
||||
NestApplicationContextOptions = NestApplicationContextOptions,
|
||||
TAppOptions extends NestApplicationContextOptions =
|
||||
NestApplicationContextOptions,
|
||||
> {
|
||||
private readonly routerProxy = new RouterProxy();
|
||||
private readonly exceptionFiltersCache = new WeakMap();
|
||||
|
||||
@@ -38,9 +38,9 @@ import { Module } from './injector/module';
|
||||
* @publicApi
|
||||
*/
|
||||
export class NestApplicationContext<
|
||||
TOptions extends
|
||||
NestApplicationContextOptions = NestApplicationContextOptions,
|
||||
>
|
||||
TOptions extends NestApplicationContextOptions =
|
||||
NestApplicationContextOptions,
|
||||
>
|
||||
extends AbstractInstanceResolver
|
||||
implements INestApplicationContext
|
||||
{
|
||||
|
||||
@@ -7,8 +7,7 @@ import { RequestContext } from '../interfaces';
|
||||
export class RequestContextHost<
|
||||
TData = any,
|
||||
TContext extends BaseRpcContext = any,
|
||||
> implements RequestContext<TData>
|
||||
{
|
||||
> implements RequestContext<TData> {
|
||||
constructor(
|
||||
public readonly pattern: string | Record<string, any>,
|
||||
public readonly data: TData,
|
||||
|
||||
@@ -5,9 +5,10 @@ import { Deserializer, IncomingResponse } from '../interfaces';
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export class KafkaResponseDeserializer
|
||||
implements Deserializer<any, IncomingResponse>
|
||||
{
|
||||
export class KafkaResponseDeserializer implements Deserializer<
|
||||
any,
|
||||
IncomingResponse
|
||||
> {
|
||||
deserialize(message: any, options?: Record<string, any>): IncomingResponse {
|
||||
const id = message.headers[KafkaHeaders.CORRELATION_ID].toString();
|
||||
if (!isUndefined(message.headers[KafkaHeaders.NEST_ERR])) {
|
||||
|
||||
@@ -12,9 +12,10 @@ import { RpcException } from './rpc-exception';
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export class BaseRpcExceptionFilter<T = any, R = any>
|
||||
implements RpcExceptionFilter<T>
|
||||
{
|
||||
export class BaseRpcExceptionFilter<
|
||||
T = any,
|
||||
R = any,
|
||||
> implements RpcExceptionFilter<T> {
|
||||
private static readonly logger = new Logger('RpcExceptionsHandler');
|
||||
|
||||
public catch(exception: T, host: ArgumentsHost): Observable<R> {
|
||||
|
||||
@@ -6,8 +6,10 @@ import {
|
||||
TopicPartitionOffsetAndMetadata,
|
||||
} from '../external/kafka.interface';
|
||||
|
||||
export interface ClientKafkaProxy
|
||||
extends Omit<ClientProxy<never, KafkaStatus>, 'on'> {
|
||||
export interface ClientKafkaProxy extends Omit<
|
||||
ClientProxy<never, KafkaStatus>,
|
||||
'on'
|
||||
> {
|
||||
/**
|
||||
* Reference to the Kafka consumer instance.
|
||||
*/
|
||||
|
||||
@@ -21,8 +21,8 @@ import { ListenersController } from './listeners-controller';
|
||||
import { Server } from './server/server';
|
||||
|
||||
export class MicroservicesModule<
|
||||
TAppOptions extends
|
||||
NestApplicationContextOptions = NestApplicationContextOptions,
|
||||
TAppOptions extends NestApplicationContextOptions =
|
||||
NestApplicationContextOptions,
|
||||
> {
|
||||
private readonly clientsContainer = new ClientsContainer();
|
||||
private listenersController: ListenersController;
|
||||
|
||||
@@ -18,8 +18,10 @@ export interface ClientsModuleOptionsFactory {
|
||||
createClientOptions(): Promise<ClientProvider> | ClientProvider;
|
||||
}
|
||||
|
||||
export interface ClientsProviderAsyncOptions
|
||||
extends Pick<ModuleMetadata, 'imports'> {
|
||||
export interface ClientsProviderAsyncOptions extends Pick<
|
||||
ModuleMetadata,
|
||||
'imports'
|
||||
> {
|
||||
useExisting?: Type<ClientsModuleOptionsFactory>;
|
||||
useClass?: Type<ClientsModuleOptionsFactory>;
|
||||
useFactory?: (...args: any[]) => Promise<ClientProvider> | ClientProvider;
|
||||
|
||||
@@ -16,9 +16,10 @@ export interface KafkaRequest<T = any> {
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export class KafkaRequestSerializer
|
||||
implements Serializer<any, KafkaRequest | Promise<KafkaRequest>>
|
||||
{
|
||||
export class KafkaRequestSerializer implements Serializer<
|
||||
any,
|
||||
KafkaRequest | Promise<KafkaRequest>
|
||||
> {
|
||||
serialize(value: any) {
|
||||
const isNotKafkaMessage =
|
||||
isNil(value) ||
|
||||
|
||||
@@ -7,9 +7,10 @@ import { NatsRecord, NatsRecordBuilder } from '../record-builders';
|
||||
|
||||
let natsPackage = {} as any;
|
||||
|
||||
export class NatsRecordSerializer
|
||||
implements Serializer<ReadPacket, NatsRecord>
|
||||
{
|
||||
export class NatsRecordSerializer implements Serializer<
|
||||
ReadPacket,
|
||||
NatsRecord
|
||||
> {
|
||||
private readonly jsonCodec: NatsCodec<unknown>;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -3,9 +3,10 @@ import { ReadPacket } from '../interfaces';
|
||||
import { Serializer } from '../interfaces/serializer.interface';
|
||||
import { RmqRecord } from '../record-builders';
|
||||
|
||||
export class RmqRecordSerializer
|
||||
implements Serializer<ReadPacket, ReadPacket & Partial<RmqRecord>>
|
||||
{
|
||||
export class RmqRecordSerializer implements Serializer<
|
||||
ReadPacket,
|
||||
ReadPacket & Partial<RmqRecord>
|
||||
> {
|
||||
serialize(packet: ReadPacket): ReadPacket & Partial<RmqRecord> {
|
||||
if (
|
||||
packet?.data &&
|
||||
|
||||
@@ -13,8 +13,10 @@ export interface MulterOptionsFactory {
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface MulterModuleAsyncOptions
|
||||
extends Pick<ModuleMetadata, 'imports'> {
|
||||
export interface MulterModuleAsyncOptions extends Pick<
|
||||
ModuleMetadata,
|
||||
'imports'
|
||||
> {
|
||||
useExisting?: Type<MulterOptionsFactory>;
|
||||
useClass?: Type<MulterOptionsFactory>;
|
||||
useFactory?: (
|
||||
|
||||
@@ -122,8 +122,8 @@ type FastifyRawRequest<TServer extends RawServerBase> =
|
||||
export class FastifyAdapter<
|
||||
TServer extends RawServerBase = RawServerDefault,
|
||||
TRawRequest extends FastifyRawRequest<TServer> = FastifyRawRequest<TServer>,
|
||||
TRawResponse extends
|
||||
RawReplyDefaultExpression<TServer> = RawReplyDefaultExpression<TServer>,
|
||||
TRawResponse extends RawReplyDefaultExpression<TServer> =
|
||||
RawReplyDefaultExpression<TServer>,
|
||||
TRequest extends FastifyRequest<
|
||||
RequestGenericInterface,
|
||||
TServer,
|
||||
@@ -135,11 +135,8 @@ export class FastifyAdapter<
|
||||
TRawRequest,
|
||||
TRawResponse
|
||||
> = FastifyReply<RouteGenericInterface, TServer, TRawRequest, TRawResponse>,
|
||||
TInstance extends FastifyInstance<
|
||||
TServer,
|
||||
TRawRequest,
|
||||
TRawResponse
|
||||
> = FastifyInstance<TServer, TRawRequest, TRawResponse>,
|
||||
TInstance extends FastifyInstance<TServer, TRawRequest, TRawResponse> =
|
||||
FastifyInstance<TServer, TRawRequest, TRawResponse>,
|
||||
> extends AbstractHttpAdapter<TServer, TRequest, TReply> {
|
||||
protected readonly logger = new Logger(FastifyAdapter.name);
|
||||
protected readonly instance: TInstance;
|
||||
|
||||
@@ -14,8 +14,7 @@ export abstract class AbstractWsAdapter<
|
||||
TServer extends BaseWsInstance = any,
|
||||
TClient extends BaseWsInstance = any,
|
||||
TOptions = any,
|
||||
> implements WebSocketAdapter<TServer, TClient, TOptions>
|
||||
{
|
||||
> implements WebSocketAdapter<TServer, TClient, TOptions> {
|
||||
protected readonly httpServer: any;
|
||||
private _forceCloseConnections: boolean;
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ interface BaseWsExceptionFilterOptions {
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export class BaseWsExceptionFilter<TError = any>
|
||||
implements WsExceptionFilter<TError>
|
||||
{
|
||||
export class BaseWsExceptionFilter<
|
||||
TError = any,
|
||||
> implements WsExceptionFilter<TError> {
|
||||
protected static readonly logger = new Logger('WsExceptionsHandler');
|
||||
|
||||
constructor(protected readonly options: BaseWsExceptionFilterOptions = {}) {
|
||||
|
||||
@@ -26,8 +26,8 @@ import { WebSocketsController } from './web-sockets-controller';
|
||||
|
||||
export class SocketModule<
|
||||
THttpServer = any,
|
||||
TAppOptions extends
|
||||
NestApplicationContextOptions = NestApplicationContextOptions,
|
||||
TAppOptions extends NestApplicationContextOptions =
|
||||
NestApplicationContextOptions,
|
||||
> {
|
||||
private readonly socketsContainer = new SocketsContainer();
|
||||
private applicationConfig: ApplicationConfig;
|
||||
|
||||
Reference in New Issue
Block a user