mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-30 04:18:51 +03:00
style: applied linter rules for all files
This commit is contained in:
@@ -19,8 +19,9 @@ export function createListenerDecorator<
|
||||
args,
|
||||
} as ListenerMetadata,
|
||||
];
|
||||
|
||||
const previousValue = Reflect.getMetadata(LISTENERS_METADATA, descriptor.value) || [];
|
||||
|
||||
const previousValue =
|
||||
Reflect.getMetadata(LISTENERS_METADATA, descriptor.value) || [];
|
||||
const value = [...previousValue, ...metadata];
|
||||
Reflect.defineMetadata(LISTENERS_METADATA, value, descriptor.value);
|
||||
return descriptor;
|
||||
|
@@ -5,8 +5,10 @@ import { PARAM_ARGS_METADATA } from '../telegraf.constants';
|
||||
|
||||
export type ParamData = object | string | number;
|
||||
|
||||
export const createTelegrafParamDecorator = (paramtype: TelegrafParamtype) => {
|
||||
return (data?: ParamData): ParameterDecorator => (target, key, index) => {
|
||||
export const createTelegrafParamDecorator =
|
||||
(paramtype: TelegrafParamtype) =>
|
||||
(data?: ParamData): ParameterDecorator =>
|
||||
(target, key, index) => {
|
||||
const args =
|
||||
Reflect.getMetadata(PARAM_ARGS_METADATA, target.constructor, key) || {};
|
||||
Reflect.defineMetadata(
|
||||
@@ -16,16 +18,16 @@ export const createTelegrafParamDecorator = (paramtype: TelegrafParamtype) => {
|
||||
key,
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export const createTelegrafPipesParamDecorator = (
|
||||
paramtype: TelegrafParamtype,
|
||||
) => (
|
||||
data?: any,
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator => (target, key, index) => {
|
||||
addPipesMetadata(paramtype, data, pipes, target, key, index);
|
||||
};
|
||||
export const createTelegrafPipesParamDecorator =
|
||||
(paramtype: TelegrafParamtype) =>
|
||||
(
|
||||
data?: any,
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator =>
|
||||
(target, key, index) => {
|
||||
addPipesMetadata(paramtype, data, pipes, target, key, index);
|
||||
};
|
||||
|
||||
export const addPipesMetadata = (
|
||||
paramtype: TelegrafParamtype,
|
||||
|
Reference in New Issue
Block a user