Skip to content

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!

@WikiRik
Copy link
Member

WikiRik commented Mar 27, 2025

This feature should be added in #2474

@WikiRik WikiRik closed this Mar 27, 2025
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