Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 81b754b

Browse files
committed
Merge pull request #11 from hapijs/es6
es6. Closes #10
2 parents 44b7ac3 + ad37539 commit 81b754b

11 files changed

+403
-399
lines changed

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: node_js
2+
23
node_js:
3-
- "0.10"
4-
- "4.0"
5-
- "4"
4+
- 4.0
5+
- 4
6+
- 5
7+
68
sudo: false

CONTRIBUTING.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# How to contribute
2+
We welcome contributions from the community and are pleased to have them. Please follow this guide when logging issues or making code changes.
3+
4+
## Logging Issues
5+
All issues should be created using the [new issue form](https://github.com/hapijs/isemail/issues/new). Clearly describe the issue including steps
6+
to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported.
7+
8+
## Patching Code
9+
10+
Code changes are welcome and should follow the guidelines below.
11+
12+
* Fork the repository on GitHub.
13+
* Fix the issue ensuring that your code follows the [style guide](https://github.com/hapijs/contrib/blob/master/Style.md).
14+
* Add tests for your new code ensuring that you have 100% code coverage (we can help you reach 100% but will not merge without it).
15+
* Run `npm test` to generate a report of test coverage
16+
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/hapijs/isemail/tree/master).

LICENSE

+28-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1-
Copyright © 2008-2011, Dominic Sayers
2-
Copyright © 2013-2014, GlobeSherpa
3-
Copyright © 2014-2015, Eli Skeggs
1+
Copyright (c) 2014-2015, Eli Skeggs and other contributors.
2+
Copyright (c) 2013-2014, GlobeSherpa.
3+
Copyright (c) 2008-2011, Dominic Sayers.
44

55
All rights reserved.
66

7-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
* Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
* The names of any contributors may not be used to endorse or promote
15+
products derived from this software without specific prior written
16+
permission.
817

9-
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10-
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11-
- Neither the name of Dominic Sayers nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
22+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
* * *
30+
31+
The complete list of contributors can be found at: https://github.com/hapijs/ammo/graphs/contributors
32+
Previously published under the 2-Clause-BSD license published here: https://github.com/hapijs/isemail/blob/v1.2.0/LICENSE
1233

13-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

-4
This file was deleted.

README.md

100644100755
+16-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
isemail
2-
=======
1+
# isemail
32

43
Node email address validation library
54

@@ -34,12 +33,12 @@ _remember to_ `npm install` to get the development dependencies!
3433
API
3534
===
3635

37-
isEmail(email, [options], [callback])
38-
-------------------------------------
36+
validate(email, [options], [callback])
37+
--------------------------------------
3938

40-
Determines whether the `email` is valid or not, for various definitions thereof. Optionally accepts an `options` object and a `callback` function. Options may include `errorLevel` and `checkDNS`. The `callback` function will always be called if specified, and the result of the operation supplied as the only parameter to the callback function. If `isEmail` is not asked to check for the existence of the domain (`checkDNS`), it will also synchronously return the result of the operation.
39+
Determines whether the `email` is valid or not, for various definitions thereof. Optionally accepts an `options` object and a `callback` function. Options may include `errorLevel` and `checkDNS`. The `callback` function will always be called if specified, and the result of the operation supplied as the only parameter to the callback function. If `validate()` is not asked to check for the existence of the domain (`checkDNS`), it will also synchronously return the result of the operation.
4140

42-
Use `errorLevel` to specify the type of result for `isEmail`. Passing a `false` literal will result in a true or false boolean indicating whether the email address is sufficiently defined for use in sending an email. Passing a `true` literal will result in a more granular numeric status, with zero being a perfectly valid email address. Passing a number will return `0` if the numeric status is below the `errorLevel` and the numeric status otherwise.
41+
Use `errorLevel` to specify the type of result for `validate()`. Passing a `false` literal will result in a true or false boolean indicating whether the email address is sufficiently defined for use in sending an email. Passing a `true` literal will result in a more granular numeric status, with zero being a perfectly valid email address. Passing a number will return `0` if the numeric status is below the `errorLevel` and the numeric status otherwise.
4342

4443
The `tldWhitelist` option can be either an object lookup table or an array of valid top-level domains. If the email address has a top-level domain that is not in the whitelist, the email will be marked as invalid.
4544

@@ -49,43 +48,38 @@ The `minDomainAtoms` option is an optional positive integer that specifies the m
4948

5049
```js
5150
$ node
52-
> var isEmail = require('isemail');
51+
> var Isemail = require('isemail');
5352
undefined
5453
> var log = console.log.bind(console, 'result');
5554
undefined
56-
> isEmail('[email protected]');
55+
> Isemail.validate('[email protected]');
5756
true
58-
> isEmail('[email protected]', log);
57+
> Isemail.validate('[email protected]', log);
5958
result true
6059
true
61-
> isEmail('[email protected]', {checkDNS: true});
60+
> Isemail.validate('[email protected]', {checkDNS: true});
6261
undefined
63-
> isEmail('[email protected]', {checkDNS: true}, log);
62+
> Isemail.validate('[email protected]', {checkDNS: true}, log);
6463
undefined
6564
result true
66-
> isEmail('[email protected]', {errorLevel: true});
65+
> Isemail.validate('[email protected]', {errorLevel: true});
6766
0
68-
> isEmail('[email protected]', {errorLevel: true}, log);
67+
> Isemail.validate('[email protected]', {errorLevel: true}, log);
6968
result 0
7069
0
71-
> isEmail('[email protected]');
70+
> Isemail.validate('[email protected]');
7271
true
73-
> isEmail('[email protected]', {checkDNS: true, errorLevel: true}, log);
72+
> Isemail.validate('[email protected]', {checkDNS: true, errorLevel: true}, log);
7473
undefined
7574
result 6
76-
> isEmail('[email protected]', {checkDNS: true, errorLevel: 7}, log);
75+
> Isemail.validate('[email protected]', {checkDNS: true, errorLevel: 7}, log);
7776
undefined
7877
result 0
79-
> isEmail('[email protected]', {checkDNS: true, errorLevel: 6}, log);
78+
> Isemail.validate('[email protected]', {checkDNS: true, errorLevel: 6}, log);
8079
undefined
8180
result 6
8281
```
8382

84-
License
85-
=======
86-
87-
[BSD License](http://www.opensource.org/licenses/bsd-license.php)
88-
8983
<sup name="footnote-1">&#91;1&#93;</sup>: if this badge indicates the build is passing, then isemail has 100% code coverage.
9084

9185
[skeggse]: https://github.com/skeggse "Eli Skeggs"

index.js

-1
This file was deleted.

0 commit comments

Comments
 (0)