Skip to content

Add support for 'is.email' #66

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
34 changes: 17 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
98 changes: 49 additions & 49 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# Contributing to checkif.js

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## We Develop with Github

We use github to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests (aiming at 100% coverage).
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/joeltankam/checkif.js/issues)

We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/joeltankam/checkif.js/issues); it's that easy! Make sure to follow the [bug report template](https://github.com/joeltankam/checkif.js/blob/master/.github/ISSUE_TEMPLATE/bug_report.md).

## Request features using Github's [issues](https://github.com/joeltankam/checkif.js/issues)

Request a feature by [opening a new issue](https://github.com/joeltankam/checkif.js/issues). Make sure to follow the [feature request template](https://github.com/joeltankam/checkif.js/blob/master/.github/ISSUE_TEMPLATE/feature_request.md).

## Use a Consistent Coding Style

- Make sure you're using our `.editorconfig` file
- Make sure you're running `eslint`. You can check the integration with your editor in the [official documentation](https://eslint.org/docs/user-guide/integrations)

## License

By contributing, you agree that your contributions will be licensed under its MIT License.

## References

This document was adapted from [briandk's Contributing.md](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62)
# Contributing to checkif.js
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
## We Develop with Github
We use github to host code, to track issues and feature requests, as well as accept pull requests.
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests (aiming at 100% coverage).
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!
## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
## Report bugs using Github's [issues](https://github.com/joeltankam/checkif.js/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/joeltankam/checkif.js/issues); it's that easy! Make sure to follow the [bug report template](https://github.com/joeltankam/checkif.js/blob/master/.github/ISSUE_TEMPLATE/bug_report.md).
## Request features using Github's [issues](https://github.com/joeltankam/checkif.js/issues)
Request a feature by [opening a new issue](https://github.com/joeltankam/checkif.js/issues). Make sure to follow the [feature request template](https://github.com/joeltankam/checkif.js/blob/master/.github/ISSUE_TEMPLATE/feature_request.md).
## Use a Consistent Coding Style
- Make sure you're using our `.editorconfig` file
- Make sure you're running `eslint`. You can check the integration with your editor in the [official documentation](https://eslint.org/docs/user-guide/integrations)
## License
By contributing, you agree that your contributions will be licensed under its MIT License.
## References
This document was adapted from [briandk's Contributing.md](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62)
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2018 Joël TANKAM

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2018 Joël TANKAM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,36 @@ is.windowObject(dom.window); // true

This group of methods allows to verify _if_ a given string _is_ from a specific known type of value.

_To be implemented_
##### `email(value)`
Check _if_ a given string _is_ an email. This verification is done according to [RFC5322](https://tools.ietf.org/html/rfc5322#section-3.2.3) official standard.

```js
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('[email protected]') // true
is.email('" "@example.org') // true
is.email('"john..doe"@example.com') // true
is.email('example.with.ip@[192.168.2.1]') // true
is.email('"with(comment)@example.com') // true
is.email('"with@(comment)example.com') // true

is.email('Abc.example.com') // false, no @ character
is.email('@example.com') // false, no local part
is.email('A@b@[email protected]') // false, only one @ is allowed outside quotation marks
is.email('a"b(c)d,e:f;g<h>i[j\k][email protected]') // false, none of the special characters in this local-part are allowed outside quotation marks
is.email('just"not"[email protected]') // false, quoted strings must be dot separated or the only element making up the local-part
is.email('this is"not\[email protected]') // false, spaces, quotes, and backslashes may only exist when within quoted strings and preceded by a backslash
is.email('this\ still\"not\\[email protected]') // false, even if escaped (preceded by a backslash), spaces, quotes, and backslashes must still be contained by quotes
is.email('1234567890123456789012345678901234567890123456789012345678901234+x@example.com') // false, local part is longer than 64 characters
is.email('[email protected]') // false, double dot before @
is.email('[email protected]') // false, double dot after @
```

#### String

Expand Down
Loading