-
Notifications
You must be signed in to change notification settings - Fork 1
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
Arn 2342 dev accommodation design changes #639
base: main
Are you sure you want to change the base?
Conversation
return !value || value === '' ? true : date.isValid && date >= now | ||
} | ||
|
||
export function validateValidDate(value: string) { |
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.
There's now 3 functions that do specific things but the code is very similar. Not sure if this is okay or are there better ways on coding this?
(Description number 2 of ticket)
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.
Good spot! there is definitely common functionality across these three validators which could be abstracted out in to it's own function, which I think sacrifices some simplicity in favour of maintainability, feel free to give refactoring a go
No description provided.