add support for undefined value in isOptional#102
Conversation
|
@pleerock I was wondering if you would look over this PR |
There was a problem hiding this comment.
Shouldn't undefined be treated differently as it is not same as empty string or null. Suppose if property is of type boolean it would allow empty string or null to bypass the validation, though they are incorrect (say it is being stored in database), I think there should be a new decorator @IsNotRequired() which explicitly ignores validation if value is only undefined. Or if you want to follow semantics of Typescript, functionality of @IsOptional() and @IsNotRequired() can be switched with above semantics, which would be a breaking change.
|
As @adnan-kamili said, why does And it would be great if it both Added: Also, I wonder if |
|
@pleerock allowing null or empty string to bypass in |
|
@pleerock You merge but never released it to npm. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
fixes #101