You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In TypeStack class-validator, validate() input validation can be bypassed because certain internal attributes can be overwritten via a conflicting name. Even though there is an optional forbidUnknownValues parameter that can be used to reduce the risk of this bypass, this option is not documented and thus most developers configure input validation in the vulnerable default manner. With this vulnerability, attackers can launch SQL Injection or XSS attacks by injecting arbitrary malicious input.
The default settings for forbidUnknownValues has been changed to true in 0.14.0.
NOTE: a software maintainer agrees with the "is not documented" finding but suggests that much of the responsibility for the risk lies in a different product.
add @IsTimeZone decorator to check if given string is valid IANA time zone
add @IsISO4217CurrencyCode decorator to check if the string is an ISO 4217 currency code
add @IsStrongPassword decorator to check if given password matches specific complexity criteria
add @IsBase58 decorator to check if a string is base58 encoded
add @IsTaxId decorator to check if a given string is a valid tax ID in a given locale
add support for passing function as date generator in @MinDate and @MaxDate decorators
add option to print constraint error message instead of constraint type in validation error
improve decorator metadata lookup performance
return possible values in error message for @IsEnum decorator
Fixed
re-added @types/validator as dependency
fix error generation when using @NestedValidation
pass validation options correctly to validator in @IsDateString decorator
support passing Symbol as parameter in error message generation
specify supported locales for @IsAlphanumeric decorator
correctly assign decorator name in metadata instead of loosing it
fix various spelling errors in documentation
fix various spelling errors and inconsistencies in JSDoc for decorators
Changed
enable forbidUnknownValues option by default
remove documentation about deprecated schema based validation and added warning
update warning message logged about missing decorator metadata
update libphonenumber-js to ^1.10.14 from ^1.9.43
update various dev-dependencies
BREAKING CHANGES
forbidUnknownValues option is enabled by default
From this release the forbidUnknownValues is enabled by default. This is the desired behavior for majority of
use-cases, but this change may break validation for some. The two scenarios that results in failed validation:
when attempting to validate a class instance without metadata for it
when using group validation and the specified validation group results in zero validation applied
The old behavior can be restored via specifying forbidUnknownValues: false option when calling the validate functions.
Until now the errors from a nested validation in some cases were incorrectly assigned
to the parent instead of the child being validated. Now the validation errors are correctly assigned.
NOTE: This version fixes a security vulnerability allowing denial of service attacks with a specially crafted request payload.
Please update as soon as possible.
Fixed
switched to use Array.isArray in array checks from instanceof operator
Changed
libphonenumber-js package updated to 1.9.43 from 1.9.7
updated validator.js from 7.0.0 to 9.2.0 (Check it's changelog 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
0.6.7
Fixed
fixed issue with @ValidateNested when nested property is not defined and it throw an error (#59)
0.6.5
Fixed
fixed bugs with @IsUrl, @IsEmail and several other decorators
0.6.4
Added
added @IsMilitaryTime decorator.
0.6.3
Added
added validateOrReject method which rejects promise instead of returning array of errors in resolved result
0.6.1
Added
added @IsArray decorator.
0.6.0 [BREAKING CHANGE]
Added
breaking change with @ValidateNested on arrays: Validator now groups the validation errors by sub-object, rather than them all being grouped together. See #32 for a demonstration of the updated structure.
added @ValidateIf decorator, see conditional validation in docs.
0.5.0 [BREAKING CHANGE]
Added
async validations must be marked with { async: true } option now.
This is optional, but it helps to determine which decorators are async to prevent their execution in validateSync method.
added validateSync method that performs non asynchronous validation and ignores validations that marked with async: true.
there is a breaking change in registerDecorator method. Now it accepts options object.
breaking change with @ValidatorConstraint decorator. Now it accepts option object instead of single name.
0.4.1
Fixed
fixed issue with wrong source maps packaged
0.4.0 [BREAKING CHANGE]
Added
everything should be imported from "class-validator" main entry point now
ValidatorInterface has been renamed to ValidatorConstraintInterface
contain can be set in the main entry point now
some decorator's names changed. Be aware of this
added few more non-string decorators
validator now returns array of ValidationError instead of ValidationErrorInterface. Removed old ValidationError
removed all other validation methods except validator.validate
finally validate method is async now, so custom async validations are supported now
added ability to validate inherited properties
added support of separate validation schemas
added support of default validation messages
added support of special tokens in validation messages
added support of message functions in validation options
added support of custom decorators
if no groups were specified, decorators with groups now are being ignored
changed signature of the ValidationError. Now if it has nested errors it does not return them in a flat array
Fixed
fixed all decorators that should not work only with strings
0.3.0
Added
package has changed its name from validator.ts to class-validator.
sanitation functionality has been removed from this library. Use class-sanitizer instead.
add @IsTimeZone decorator to check if given string is valid IANA time zone
add @IsISO4217CurrencyCode decorator to check if the string is an ISO 4217 currency code
add @IsStrongPassword decorator to check if given password matches specific complexity criteria
add @IsBase58 decorator to check if a string is base58 encoded
add @IsTaxId decorator to check if a given string is a valid tax ID in a given locale
add support for passing function as date generator in @MinDate and @MaxDate decorators
add option to print constraint error message instead of constraint type in validation error
improve decorator metadata lookup performance
return possible values in error message for @IsEnum decorator
Fixed
re-added @types/validator as dependency
fix error generation when using @NestedValidation
pass validation options correctly to validator in @IsDateString decorator
support passing Symbol as parameter in error message generation
specify supported locales for @IsAlphanumeric decorator
correctly assign decorator name in metadata instead of loosing it
fix various spelling errors in documentation
fix various spelling errors and inconsistencies in JSDoc for decorators
Changed
enable forbidUnknownValues option by default
remove documentation about deprecated schema based validation and added warning
update warning message logged about missing decorator metadata
update libphonenumber-js to ^1.10.14 from ^1.9.43
update various dev-dependencies
BREAKING CHANGES
forbidUnknownValues option is enabled by default
From this release the forbidUnknownValues is enabled by default. This is the desired behavior for majority of
use-cases, but this change may break validation for some. The two scenarios that results in failed validation:
when attempting to validate a class instance without metadata for it
when using group validation and the specified validation group results in zero validation applied
The old behavior can be restored via specifying forbidUnknownValues: false option when calling the validate functions.
Until now the errors from a nested validation in some cases were incorrectly assigned
to the parent instead of the child being validated. Now the validation errors are correctly assigned.
NOTE: This version fixes a security vulnerability allowing denial of service attacks with a specially crafted request payload.
Please update as soon as possible.
Fixed
switched to use Array.isArray in array checks from instanceof operator
Changed
libphonenumber-js package updated to 1.9.43 from 1.9.7
updated validator.js from 7.0.0 to 9.2.0 (Check it's changelog 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
0.6.7
Fixed
fixed issue with @ValidateNested when nested property is not defined and it throw an error (#59)
0.6.5
Fixed
fixed bugs with @IsUrl, @IsEmail and several other decorators
0.6.4
Added
added @IsMilitaryTime decorator.
0.6.3
Added
added validateOrReject method which rejects promise instead of returning array of errors in resolved result
0.6.1
Added
added @IsArray decorator.
0.6.0 [BREAKING CHANGE]
Added
breaking change with @ValidateNested on arrays: Validator now groups the validation errors by sub-object, rather than them all being grouped together. See #32 for a demonstration of the updated structure.
added @ValidateIf decorator, see conditional validation in docs.
0.5.0 [BREAKING CHANGE]
Added
async validations must be marked with { async: true } option now.
This is optional, but it helps to determine which decorators are async to prevent their execution in validateSync method.
added validateSync method that performs non asynchronous validation and ignores validations that marked with async: true.
there is a breaking change in registerDecorator method. Now it accepts options object.
breaking change with @ValidatorConstraint decorator. Now it accepts option object instead of single name.
0.4.1
Fixed
fixed issue with wrong source maps packaged
0.4.0 [BREAKING CHANGE]
Added
everything should be imported from "class-validator" main entry point now
ValidatorInterface has been renamed to ValidatorConstraintInterface
contain can be set in the main entry point now
some decorator's names changed. Be aware of this
added few more non-string decorators
validator now returns array of ValidationError instead of ValidationErrorInterface. Removed old ValidationError
removed all other validation methods except validator.validate
finally validate method is async now, so custom async validations are supported now
added ability to validate inherited properties
added support of separate validation schemas
added support of default validation messages
added support of special tokens in validation messages
added support of message functions in validation options
added support of cust
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
This PR contains the following updates:
0.9.1->0.14.0Warning
Some dependencies could not be looked up. Check the warning logs for more information.
GitHub Vulnerability Alerts
CVE-2019-18413
In TypeStack class-validator,
validate()input validation can be bypassed because certain internal attributes can be overwritten via a conflicting name. Even though there is an optionalforbidUnknownValuesparameter that can be used to reduce the risk of this bypass, this option is not documented and thus most developers configure input validation in the vulnerable default manner. With this vulnerability, attackers can launch SQL Injection or XSS attacks by injecting arbitrary malicious input.The default settings for
forbidUnknownValueshas been changed totruein 0.14.0.NOTE: a software maintainer agrees with the "is not documented" finding but suggests that much of the responsibility for the risk lies in a different product.
Release Notes
typestack/class-validator (class-validator)
v0.14.0Compare Source
Fixed
forbidUnknownValuesdid not default totruewhenvalidatorOptionswas undefined. (#2196 by @cduff)ValidationMetadata.nameproperty to work correctly with the@IsOptionaldecorator. (#2044 by @Clashsoft)@IsBase64decorator. (#2549 by @aseyfpour)isBase64function. (#2574 by @braaar)0.14.1 (2024年01月12日)
Added
@IsBase64decorator (#1845) , closes #1013@IsUUIDdecorator (#1846) , closes #1497@IsPhoneNumberdecorator to use max dataset (#1857)Fixed
@IsIndecorator (#1844) , closes #1693@IsNotEmptyObjectdecorator correctly (#1555) , closes #1554Changed
libphonenumber-jsto^1.10.53from^1.10.140.14.0 (2022年12月09日)
Added
@IsTimeZonedecorator to check if given string is valid IANA time zone@IsISO4217CurrencyCodedecorator to check if the string is an ISO 4217 currency code@IsStrongPassworddecorator to check if given password matches specific complexity criteria@IsBase58decorator to check if a string is base58 encoded@IsTaxIddecorator to check if a given string is a valid tax ID in a given locale@MinDateand@MaxDatedecorators@IsEnumdecoratorFixed
@types/validatoras dependency@NestedValidation@IsDateStringdecoratorSymbolas parameter in error message generation@IsAlphanumericdecoratorChanged
forbidUnknownValuesoption by defaultlibphonenumber-jsto^1.10.14from^1.9.43BREAKING CHANGES
forbidUnknownValuesoption is enabled by defaultFrom this release the
forbidUnknownValuesis enabled by default. This is the desired behavior for majority ofuse-cases, but this change may break validation for some. The two scenarios that results in failed validation:
The old behavior can be restored via specifying
forbidUnknownValues: falseoption when calling the validate functions.For more details see PR #1798 and #1422 (comment).
@NestedValidationdecorator correctly assigns validation errorsUntil now the errors from a nested validation in some cases were incorrectly assigned
to the parent instead of the child being validated. Now the validation errors are correctly assigned.
For more details see #679.
0.13.2 (2021年11月20日)
Fixed
Array.isArrayin array checks frominstanceofoperatorChanged
libphonenumber-jspackage updated to1.9.43from1.9.7validatorpackage updated to13.5.2from13.5.20.13.1 (2021年01月14日)
Added
ArrayUniquedecoratorFixed
IsUUIDdecoratorValidationError.toString()doesn't result in an error whenforbidNonWhitelistedparameter was usedIsIndecorator@types/validatorpackage is correctly installedinlineSourcesoption is enabled in tsconfig preventing various sourcemap errors when consuming the packageChanged
0.13.0 (2021年01月11日)
Added
always- allows setting global default foralwaysoption for decoratorsstrictGroups- ignore decorators with at least one group, whenValidatorOptions.groupsis emptyFixed
isPostalCodedecorator (#634)IsDateString()decorator now aliases theIsISO8601()decorator (#672)Changed
0.12.2 (2020年04月23日)
Fixed
tslibfrompeerDependenciestodependencies(827eff1), closes #5880.12.1 (2020年04月18日)
Fixed
0.12.0 (2020年04月18日)
Fixed
constraintsproperty in ValidationError (#465) (84680ad), closes #309Changed
Added
BREAKING CHANGES
Validatorjs releases contain some breaking changes e.g.
IsMobileNumberorIsHexColor. Please check validatorjs CHANGELOGValidation functions was removed from
Validatorclass to enable tree shaking.BEFORE:
AFTER:
IsNumberString decorator arguments changed to
@IsNumberString(ValidatorJS.IsNumericOptions, ValidationOptions).0.11.1 (2020年03月18日)
Fixed
Added
0.11.0 (2019年11月01日)
Fixed
Added
BREAKING CHANGES
0.10.2 (2019年10月14日)
Fixed
Added
0.10.1 (2019年09月25日)
Fixed
Added
skipUndefinedProperties,skipNullPropertiesoptions (#414) (76c948a), closes #3080.10.0 (2019年08月10日)
Fixed
Added
IsISO31661Alpha3andIsISO31661Alpha2validators (#273) (55c57b3)IsDecimalfrom validatorjs (#359) (b4c8e21)isPortdecorator (#282) (36684ec)ValidatePromisedecorator - resolve promise before validate (#369) (35ec04d)isNumberStringnow accept validator.jsIsNumericOptionsas second parameter (#262)BREAKING CHANGES
isDateStringnow check to match only entire ISO Date (#275) (5012464)IsCurrencyOptions,IsURLOptions,IsEmailOptions,IsFQDNOptionsinterfaces and replace with interfaces from@types/validator0.9.1
Added
Fixed
0.9.0 [BREAKING CHANGE]
Added
IsNumberStringdecorator, now they are allowed+symbol, this is not allowed anymoreIsPhoneNumberdecorator has been added which uses the google-libphonenumber library to validate international phone numbers accuratelyFixed
IsURLOptionsto match underlying validator host list optionsMinandMaxdecorator will corectly show an inclusive error message when failingvalidationArguments.valueis not a string0.8.5
Fixed
ansicolorpackage, because it's incompatible with IE0.8.4
Added
ValidatorOptionsnow has aforbidUnknownValueskey to prevent unknown objects to pass validationfalsebut will be default totrueafter the 1.0 release0.8.3
Fixed
targetproperty is undefined when callingValidationError.toString()0.8.2
Added
ValidationError.toString()method for easier debuggingprintErrormethod to pretty-print errors in NodeJS or the browserFixed
ValidatorOptionsValidationSchema(theoptionskey now is optional)IsNumericStringtoIsNumberStringin the READMEhost_whitelistandhost_backlistinIsURLOptions0.8.1
Fixed
ValidatorOptions0.8.0 [BREAKING CHANGE]
Added
updated validator.js from 7.0.0 to 9.2.0 (Check it's changelog for what has changed.)
This caused breaking change, if you used the
IsUrldecorator to validatelocalhostas a valid url, from now you must use therequire_tld: falseoptionadded
@IsInstancedecorator andvalidator.isInstance(value, target)method.changed
@IsNumberdecorator 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
@Allowdecorator to prevent stripping properties without other constraintFixed
@IsDateStringnow it allow dates without fraction seconds to be set@IsDateStringnow it allow dates without with timezones to be set@ValidateNestedcorrectly generates validation error on non object and non array values0.6.7
Fixed
@ValidateNestedwhen nested property is not defined and it throw an error (#59)0.6.5
Fixed
@IsUrl,@IsEmailand several other decorators0.6.4
Added
@IsMilitaryTimedecorator.0.6.3
Added
validateOrRejectmethod which rejects promise instead of returning array of errors in resolved result0.6.1
Added
@IsArraydecorator.0.6.0 [BREAKING CHANGE]
Added
@ValidateNestedon arrays: Validator now groups the validation errors by sub-object, rather than them all being grouped together. See #32 for a demonstration of the updated structure.@ValidateIfdecorator, see conditional validation in docs.0.5.0 [BREAKING CHANGE]
Added
async validations must be marked with
{ async: true }option now.This is optional, but it helps to determine which decorators are async to prevent their execution in
validateSyncmethod.added
validateSyncmethod that performs non asynchronous validation and ignores validations that marked withasync: true.there is a breaking change in
registerDecoratormethod. Now it accepts options object.breaking change with
@ValidatorConstraintdecorator. Now it accepts option object instead of single name.0.4.1
Fixed
0.4.0 [BREAKING CHANGE]
Added
ValidatorInterfacehas been renamed toValidatorConstraintInterfacevalidator.validateValidationError. Now if it has nested errors it does not return them in a flat arrayFixed
0.3.0
Added
validator.tstoclass-validator.v0.13.2Compare Source
Fixed
forbidUnknownValuesdid not default totruewhenvalidatorOptionswas undefined. (#2196 by @cduff)ValidationMetadata.nameproperty to work correctly with the@IsOptionaldecorator. (#2044 by @Clashsoft)@IsBase64decorator. (#2549 by @aseyfpour)isBase64function. (#2574 by @braaar)0.14.1 (2024年01月12日)
Added
@IsBase64decorator (#1845) , closes #1013@IsUUIDdecorator (#1846) , closes #1497@IsPhoneNumberdecorator to use max dataset (#1857)Fixed
@IsIndecorator (#1844) , closes #1693@IsNotEmptyObjectdecorator correctly (#1555) , closes #1554Changed
libphonenumber-jsto^1.10.53from^1.10.140.14.0 (2022年12月09日)
Added
@IsTimeZonedecorator to check if given string is valid IANA time zone@IsISO4217CurrencyCodedecorator to check if the string is an ISO 4217 currency code@IsStrongPassworddecorator to check if given password matches specific complexity criteria@IsBase58decorator to check if a string is base58 encoded@IsTaxIddecorator to check if a given string is a valid tax ID in a given locale@MinDateand@MaxDatedecorators@IsEnumdecoratorFixed
@types/validatoras dependency@NestedValidation@IsDateStringdecoratorSymbolas parameter in error message generation@IsAlphanumericdecoratorChanged
forbidUnknownValuesoption by defaultlibphonenumber-jsto^1.10.14from^1.9.43BREAKING CHANGES
forbidUnknownValuesoption is enabled by defaultFrom this release the
forbidUnknownValuesis enabled by default. This is the desired behavior for majority ofuse-cases, but this change may break validation for some. The two scenarios that results in failed validation:
The old behavior can be restored via specifying
forbidUnknownValues: falseoption when calling the validate functions.For more details see PR #1798 and #1422 (comment).
@NestedValidationdecorator correctly assigns validation errorsUntil now the errors from a nested validation in some cases were incorrectly assigned
to the parent instead of the child being validated. Now the validation errors are correctly assigned.
For more details see #679.
0.13.2 (2021年11月20日)
Fixed
Array.isArrayin array checks frominstanceofoperatorChanged
libphonenumber-jspackage updated to1.9.43from1.9.7validatorpackage updated to13.5.2from13.5.20.13.1 (2021年01月14日)
Added
ArrayUniquedecoratorFixed
IsUUIDdecoratorValidationError.toString()doesn't result in an error whenforbidNonWhitelistedparameter was usedIsIndecorator@types/validatorpackage is correctly installedinlineSourcesoption is enabled in tsconfig preventing various sourcemap errors when consuming the packageChanged
0.13.0 (2021年01月11日)
Added
always- allows setting global default foralwaysoption for decoratorsstrictGroups- ignore decorators with at least one group, whenValidatorOptions.groupsis emptyFixed
isPostalCodedecorator (#634)IsDateString()decorator now aliases theIsISO8601()decorator (#672)Changed
0.12.2 (2020年04月23日)
Fixed
tslibfrompeerDependenciestodependencies(827eff1), closes #5880.12.1 (2020年04月18日)
Fixed
0.12.0 (2020年04月18日)
Fixed
constraintsproperty in ValidationError (#465) (84680ad), closes #309Changed
Added
BREAKING CHANGES
Validatorjs releases contain some breaking changes e.g.
IsMobileNumberorIsHexColor. Please check validatorjs CHANGELOGValidation functions was removed from
Validatorclass to enable tree shaking.BEFORE:
AFTER:
IsNumberString decorator arguments changed to
@IsNumberString(ValidatorJS.IsNumericOptions, ValidationOptions).0.11.1 (2020年03月18日)
Fixed
Added
0.11.0 (2019年11月01日)
Fixed
Added
BREAKING CHANGES
0.10.2 (2019年10月14日)
Fixed
Added
0.10.1 (2019年09月25日)
Fixed
Added
skipUndefinedProperties,skipNullPropertiesoptions (#414) (76c948a), closes #3080.10.0 (2019年08月10日)
Fixed
Added
IsISO31661Alpha3andIsISO31661Alpha2validators (#273) (55c57b3)IsDecimalfrom validatorjs (#359) (b4c8e21)isPortdecorator (#282) (36684ec)ValidatePromisedecorator - resolve promise before validate (#369) (35ec04d)isNumberStringnow accept validator.jsIsNumericOptionsas second parameter (#262)BREAKING CHANGES
isDateStringnow check to match only entire ISO Date (#275) (5012464)IsCurrencyOptions,IsURLOptions,IsEmailOptions,IsFQDNOptionsinterfaces and replace with interfaces from@types/validator0.9.1
Added
Fixed
0.9.0 [BREAKING CHANGE]
Added
IsNumberStringdecorator, now they are allowed+symbol, this is not allowed anymoreIsPhoneNumberdecorator has been added which uses the google-libphonenumber library to validate international phone numbers accuratelyFixed
IsURLOptionsto match underlying validator host list optionsMinandMaxdecorator will corectly show an inclusive error message when failingvalidationArguments.valueis not a string0.8.5
Fixed
ansicolorpackage, because it's incompatible with IE0.8.4
Added
ValidatorOptionsnow has aforbidUnknownValueskey to prevent unknown objects to pass validationfalsebut will be default totrueafter the 1.0 release0.8.3
Fixed
targetproperty is undefined when callingValidationError.toString()0.8.2
Added
ValidationError.toString()method for easier debuggingprintErrormethod to pretty-print errors in NodeJS or the browserFixed
ValidatorOptionsValidationSchema(theoptionskey now is optional)IsNumericStringtoIsNumberStringin the READMEhost_whitelistandhost_backlistinIsURLOptions0.8.1
Fixed
ValidatorOptions0.8.0 [BREAKING CHANGE]
Added
updated validator.js from 7.0.0 to 9.2.0 (Check it's changelog for what has changed.)
This caused breaking change, if you used the
IsUrldecorator to validatelocalhostas a valid url, from now you must use therequire_tld: falseoptionadded
@IsInstancedecorator andvalidator.isInstance(value, target)method.changed
@IsNumberdecorator 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
@Allowdecorator to prevent stripping properties without other constraintFixed
@IsDateStringnow it allow dates without fraction seconds to be set@IsDateStringnow it allow dates without with timezones to be set@ValidateNestedcorrectly generates validation error on non object and non array values0.6.7
Fixed
@ValidateNestedwhen nested property is not defined and it throw an error (#59)0.6.5
Fixed
@IsUrl,@IsEmailand several other decorators0.6.4
Added
@IsMilitaryTimedecorator.0.6.3
Added
validateOrRejectmethod which rejects promise instead of returning array of errors in resolved result0.6.1
Added
@IsArraydecorator.0.6.0 [BREAKING CHANGE]
Added
@ValidateNestedon arrays: Validator now groups the validation errors by sub-object, rather than them all being grouped together. See #32 for a demonstration of the updated structure.@ValidateIfdecorator, see conditional validation in docs.0.5.0 [BREAKING CHANGE]
Added
async validations must be marked with
{ async: true }option now.This is optional, but it helps to determine which decorators are async to prevent their execution in
validateSyncmethod.added
validateSyncmethod that performs non asynchronous validation and ignores validations that marked withasync: true.there is a breaking change in
registerDecoratormethod. Now it accepts options object.breaking change with
@ValidatorConstraintdecorator. Now it accepts option object instead of single name.0.4.1
Fixed
0.4.0 [BREAKING CHANGE]
Added
ValidatorInterfacehas been renamed toValidatorConstraintInterfacevalidator.validateConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.