1.0.3 • Published 2 years ago
international-v8thor v1.0.3
International v8thor
Coverage
The library have the intention to validate a class or an object using a locale for typescript
The inspiration comes from joi-i18n and class-validator-multi-lang, these libraries have the objective to tranform and validate an object with a locale and the output message will be translated.
So, this library mix some other features like javax validation api:
- Custom messages keys
- Custom messages
- Uses decorators (or annotations)
- Default locales for provided decorators (english, spanish, portuguese)
Supported decorators
Decorator | Target type | Description |
---|---|---|
Required | all objects | Indicates a mandatory field |
Min | number | Acepts a min value field |
Max | number | Acepts a max value field |
Email | string | Validates an email field |
NotEmpty | string | Validates an string including multiple blank spaces |
Matches | string | Validates an string giving a regex |
AgeLimit | date | Validates 0-100 years for age limit |