1.0.3 • Published 2 years ago

international-v8thor v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

International v8thor

Coverage

Statements Branches Functions Lines

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:

  1. Custom messages keys
  2. Custom messages
  3. Uses decorators (or annotations)
  4. Default locales for provided decorators (english, spanish, portuguese)

Supported decorators

DecoratorTarget typeDescription
Requiredall objectsIndicates a mandatory field
MinnumberAcepts a min value field
MaxnumberAcepts a max value field
EmailstringValidates an email field
NotEmptystringValidates an string including multiple blank spaces
MatchesstringValidates an string giving a regex
AgeLimitdateValidates 0-100 years for age limit