-
-
Notifications
You must be signed in to change notification settings - Fork 913
Closed
Labels
FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.UtilitiesIssue or pull request concerning general utilities.Issue or pull request concerning general utilities.

Description
Description
Description
This RFC proposes adding new function for validating the phone number
The stdlib.js library offers a wide range of utility functions, including robust checks for various data formats such as email addresses (is-email-address) and others. However, it currently lacks a utility function to validate phone numbers, which is a common requirement in many applications.
To fill this gap, I propose adding a new function, is-phone-number, to the /assert/ module.
Expected Behavior:
The is-phone-number function should:
- Accept a string input.
- Validate the input against commonly used phone number formats.
- Support international and local phone number patterns.
- Return true if the input is a valid phone number, and false otherwise.
Related Issues
Related issues # , # , and # .
Questions
No.
Other
No.
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:
.
Metadata
Metadata
Assignees
Labels
FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.UtilitiesIssue or pull request concerning general utilities.Issue or pull request concerning general utilities.