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

[Feature Request] Multiple validation rules required #114

Open
sanishkr opened this issue Jan 12, 2022 · 7 comments
Open

[Feature Request] Multiple validation rules required #114

sanishkr opened this issue Jan 12, 2022 · 7 comments

Comments

@sanishkr
Copy link

Thanks for making this module.
I am curious, if there's a way to implement this:

  • ratio : (resolutionMinWidth / resolutionMinHeight) === (image width / image height)
  • min Dimensions: image's width > resolutionMinWidth && image's height > resolutionMinHeight

I need both of these validations together.
Thanks in Advance

@vutoan266
Copy link
Owner

Hi @sanishkr,
Currently, the lib just supports only one type of validation on init. So maybe we should make resolutionType accept string[] type that could support your case. Btw we still do not have the plan to do this now, I would appreciate it if you can do a pull request for it. Welcome~
Thank you, hope you doing well!

@sanishkr
Copy link
Author

Thanks for the quick reply. Will make a PR and let you know.

@sanishkr
Copy link
Author

@vutoan266
I have added 2 separate PRs for 2 possible solutions.
#115 and #116
Please have a look at them and make naming changes if required as per your convenience.

Thanks

@vutoan266
Copy link
Owner

Hi @sanishkr,
Thanks for your enthusiasm and nice try, good job bro!!
I took a look 2 pull requests and prefer resolutionType can accept an array of enums: #115
Your implementation is good. Btw I have commented on it for some suggestions, can discuss more if you have any concerns.
I will merge it when the code looks better (update document also), mark you as a contributor.
Thank you so much again :D

@sanishkr
Copy link
Author

Hi @vutoan266,

I have updated the readme as you asked. Also, I do not see any comments on the PR #115

@vutoan266
Copy link
Owner

Cool!!
You can see my comments under Conversation tab of pull request page.

@sanishkr
Copy link
Author

@vutoan266 #115 (comment)

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

No branches or pull requests

2 participants