You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
448 B

import { isSplitFactor } from '@ghostfolio/common/helper';
import {
ValidatorConstraint,
ValidatorConstraintInterface
} from 'class-validator';
@ValidatorConstraint({ name: 'isSplitFactor' })
export class IsSplitFactorConstraint implements ValidatorConstraintInterface {
public defaultMessage() {
return 'factor must be a positive number other than 1';
}
public validate(aFactor: number) {
return isSplitFactor(aFactor);
}
}