Socket
Socket
Sign inDemoInstall

class-validator

Package Overview
Dependencies
Maintainers
3
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-validator - npm Package Versions

1
6

0.10.0-rc.1

Diff

vlapo
published 0.10.0-rc.0 •

nonameprovided
published 0.9.1 •

Changelog

Source

0.9.1

Added
  • added option to pass custom context for the decorators
Fixed
  • validating against a schema will validate against that one instead of every registered one
nonameprovided
published 0.9.0 •

Changelog

Source

0.9.0 [BREAKING CHANGE]

Added
  • updated [validator.js][validator-js] from 9.2.0 to 10.4.0 (Check it's [changelog][validator-js-release-notes] for what has changed.)
    • until now fractional numbers was not allowed in the IsNumberString decorator, now they are allowed
    • until now Gmail addresses could contain multiple dots or random text after a + symbol, this is not allowed anymore
  • IsPhoneNumber decorator has been added which uses the [google-libphonenumber][google-libphonenumber] library to validate international phone numbers accurately
Fixed
  • update IsURLOptions to match underlying validator host list options
  • added a console warning when no metadata decorator is found as it's possibly not intended
  • the Min and Max decorator will corectly show an inclusive error message when failing
  • fixed a runtime error when validationArguments.value is not a string
nonameprovided
published 0.8.5 •

Changelog

Source

0.8.5

Fixed
  • remove ansicolor package, because it's incompatible with IE
nonameprovided
published 0.8.4 •

Changelog

Source

0.8.4

Added
  • ValidatorOptions now has a forbidUnknownValues key to prevent unknown objects to pass validation
    • it's highly advised to turn this option on
    • now this option defaults to false but will be default to true after the 1.0 release
nonameprovided
published 0.8.3 •

Changelog

Source

0.8.3

Fixed
  • handle when target property is undefined when calling ValidationError.toString()
nonameprovided
published 0.8.2 •

Changelog

Source

0.8.2

Added
  • added ValidationError.toString() method for easier debugging
  • added printError method to pretty-print errors in NodeJS or the browser
Fixed
  • fixed wrong type info in ValidatorOptions
  • fixed wrong type info in ValidationSchema (the options key now is optional)
  • corrected IsNumericString to IsNumberString in the README
  • fixed type of host_whitelist and host_backlist in IsURLOptions
nonameprovided
published 0.8.1 •

Changelog

Source

0.8.1

Fixed
  • fixed wrong type info in ValidatorOptions
nonameprovided
published 0.8.0 •

Changelog

Source

0.8.0 [BREAKING CHANGE]

Added
  • updated [validator.js][validator-js] from 7.0.0 to 9.2.0 (Check it's [changelog][validator-js-release-notes] for what has changed.)

    This caused breaking change, if you used the IsUrl decorator to validate localhost as a valid url, from now you must use the require_tld: false option

    @IsUrl({ require_tld: false})
    url: string;
    
  • added @IsInstance decorator and validator.isInstance(value, target) method.

  • changed @IsNumber decorator has been changed to @IsNumber(options: IsNumberOptions)

  • added option to strip unknown properties (whitelist: true)

  • added option to throw error on unknown properties (forbidNonWhitelisted: true)

  • added @Allow decorator to prevent stripping properties without other constraint

Fixed
  • fixed issue with @IsDateString now it allow dates without fraction seconds to be set
  • fixed issue with @IsDateString now it allow dates without with timezones to be set
  • @ValidateNested correctly generates validation error on non object and non array values
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc