-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: passing options when using @IsDateString() #1097
Conversation
`@IsDateString({strict: true})` doesn't work because options are not passed to the validator. Fixes typestack#1061
acb7de1
to
c6984bb
Compare
@@ -24,7 +24,7 @@ export function IsDateString( | |||
name: IS_DATE_STRING, | |||
constraints: [options], | |||
validator: { | |||
validate: (value, args): boolean => isDateString(value), | |||
validate: (value, args): boolean => isDateString(value, args.constraints[0]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work and reads better, no?
validate: (value, args): boolean => isDateString(value, args.constraints[0]), | |
validate: (value, args): boolean => isDateString(value, options), |
Would you care to rebase/merge this to get rid of merge conflicts and irrelevant changes? |
Any reason any it was closed? |
I would assume @hakimio is going to make a fresh PR instead of fixing this one. It's a bit cleaner that way, and it makes it easier to pass the unnecessarily strict commit message check |
PR #1720 |
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. |
Description
@IsDateString({strict: true})
doesn't work because options are not passed to the validator.Fixes
Fixes #1061