Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Yasmin-jones
Copy link
Contributor

No description provided.

return !value || value === '' ? true : date.isValid && date >= now
}

export function validateValidDate(value: string) {
Copy link
Contributor Author

@Yasmin-jones Yasmin-jones Oct 14, 2024

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)

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants