Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improvements and suggestions #4

Closed
PersonalityFox started this conversation in Ideas
Discussion options

Hello
I added a library to my project and encountered several inconveniences. I would like to offer a few ideas for discussion.

Why not switch to parameter destructuring? Instead of passing parameters in a specific order, you can pass them by value.
for example, instead of validateUsername('User999', 8, 20, customErrorMsg); you can use validateUsername('User999', {minLength: 8, maxLength: 20, errorMsg: customErrorMsg});

validateEmail('joaoaoao@gmail.com.com', null, null, null, true); -> validateEmail('joaoaoao@gmail.com.com', {validDomains:true});

Next, personal wishes, what was missing for full implementation in the project:

validateEmail
It is possible to set the minimum length

validateUsername
Inability to disable checks:
contains spaces, starts with a number and contains only numbers
How, for example, is this done in validatePassword

validatePassword
Registration forms often use password confirmation. The libraries lacked this feature, as well as the isEqual method in general.

What do you say?

You must be logged in to vote

Replies: 1 comment

Comment options

Thanks for the suggestions, I will consider your comments in a future update

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /