@galaxyops/validation-schemas
v2.2.0
Published
Contains standard class-validator decorators and custom decorators for use primarily in defining and validating data used in game design.
Downloads
36
Readme
@galaxyops/validation-schemas
Contains standard class-validator decorators and custom decorators for use primarily in defining and validating data used in game design.
import {
validateSync,
ValidationError,
IsDiceNotation,
} from '@galaxyops/validation-schemas';
class Turn {
@IsDiceNotation()
public diceNotation: string;
}
let turn = new Turn();
turn.diceNotation = '1d6+4';
const errors: ValidationError[] = validateSync(testClass);
// outputs 0
console.log(errors.length);
All validation decorators should be supported by @galaxyops/faker-factory enabling automatic generation of fakes.