style: applied linter rules for all files

This commit is contained in:
atassis
2022-07-09 17:40:49 +08:00
parent 91d9207ba6
commit 9935b87d45
10 changed files with 35 additions and 34 deletions

View File

@@ -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;

View File

@@ -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,