refactor: use new typescript types to to able to remove eslint-disable comment

This commit is contained in:
Xymorot 2020-11-10 21:39:19 +01:00
parent 2cd9531f3b
commit 8d91b5fb3c
1 changed files with 1 additions and 2 deletions

View File

@ -6,8 +6,7 @@ export const maxValue = Number.MAX_SAFE_INTEGER;
/**
* @param column the column which needs to be checked
*/
// eslint-disable-next-line @typescript-eslint/ban-types -- the type would be "(classOrObject: object, propertyName: string) => object" but typeorm does not provide it
export function PercentCheck(column: string): Function {
export function PercentCheck(column: string): ClassDecorator & PropertyDecorator {
return Check(
`${column} needs to be between ${minValue} and ${maxValue}`,
`${column} >= ${minValue} AND ${column} <= ${maxValue}`