I am trying to use class-validator package in my node project and somehow it is not being recognized. It throws an error
@MinLength(10, {
^
SyntaxError: Invalid or unexpected token
Here is what I'm doing:
const classValidator = require('class-validator');
module.exports = class Entity{
@MinLength(10, {
message: 'Title is too short',
})
@MaxLength(50, {
message: 'Title is too long',
})
}