-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(isHexColor): add require_hashtag
option
#2535
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
base: master
Are you sure you want to change the base?
Conversation
See my comment in #2533 (comment) |
thank you for the feedback! that makes sense. I'll implement the |
#
prefix for Hexcolor validation in isHexColor
require_hashtag
option to isHexColor
@WikiRik |
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.
Can you copy the 'default' test set to be checked against args: [{ require_hashtag: false }],
as well? Just for completeness
@WikiRik done! |
require_hashtag
option to isHexColor
require_hashtag
option
isHexColor
: Enforce#
prefix for Hexcolor validationDescription:
This PR updates the
isHexColor
function in validator.js to enforce the presence of a # prefix for hex color validation. Previously, the function accepted both formats with and without #, leading to inconsistent behavior. Hex color codes are commonly expected to start with a #, so this change aligns the implementation with industry standards.Changes Made:
Checklist
Please let me know if further adjustments or additional tests are needed!