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

isExact feature along with its tests and readme changes #1938

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Carlos-Gaxiola
Copy link

This solves #1937

Added a new feature called "isExact", this is related to "isLength", in "isLength" we provide a minimum and maximum value of the given string, in this new feature, we can provide the exact size or sizes we require our string to be.

I added a new file called "isExact" with this feature, also I added some tests and updated the readme

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

carbon

@WikiRik
Copy link
Member

WikiRik commented Mar 10, 2022

Why not make this an option in the isLength validator? So you can do isLength(string, {exact: [3,5,11] })

@Carlos-Gaxiola
Copy link
Author

Why not make this an option in the isLength validator? So you can do isLength(string, {exact: [3,5,11] })

Nice approach, I will work in that and commit my changes :)

@Carlos-Gaxiola
Copy link
Author

Why not make this an option in the isLength validator? So you can do isLength(string, {exact: [3,5,11] })

Hello, I did the changes inside the isLength function and removed the isExact file, this is how it works now the isLength function:

carbon (3)

Any comments, or commentaries, I will be glad to answer.

@WikiRik
Copy link
Member

WikiRik commented Mar 21, 2022

Would it be possible that we also have isLength("hello", [5, 6]) to return true? Since I think you don't really need the min/max if you want to add the exact

@chashamsarao
Copy link

Hello, I am interested in making a contribution towards resolving this issue @WikiRik. I need some guidance..

@WikiRik
Copy link
Member

WikiRik commented Oct 2, 2022

This feature has been implemented in #2019 but thanks for the offer!

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.

3 participants