WIP - add extractor, generate snippet_data
This commit is contained in:
32
node_modules/isemail/LICENSE
generated
vendored
Normal file
32
node_modules/isemail/LICENSE
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
Copyright (c) 2014-2015, Eli Skeggs and Project contributors
|
||||
Copyright (c) 2013-2014, GlobeSherpa
|
||||
Copyright (c) 2008-2011, Dominic Sayers
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* The names of any contributors may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
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 HOLDERS AND 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.
|
||||
|
||||
* * *
|
||||
|
||||
The complete list of contributors can be found at: https://github.com/hapijs/isemail/graphs/contributors
|
||||
Previously published under the 2-Clause-BSD license published here: https://github.com/hapijs/isemail/blob/v1.2.0/LICENSE
|
||||
|
||||
84
node_modules/isemail/README.md
generated
vendored
Executable file
84
node_modules/isemail/README.md
generated
vendored
Executable file
@ -0,0 +1,84 @@
|
||||
# isemail
|
||||
|
||||
Node email address validation library
|
||||
|
||||
[](https://travis-ci.org/hapijs/isemail)<a href="#footnote-1"><sup>[1]</sup></a>
|
||||
|
||||
Lead Maintainer: [Eli Skeggs][skeggse]
|
||||
|
||||
This library is a port of the PHP `is_email` function by Dominic Sayers.
|
||||
|
||||
Install
|
||||
=======
|
||||
|
||||
```sh
|
||||
$ npm install isemail
|
||||
```
|
||||
|
||||
Test
|
||||
====
|
||||
|
||||
The tests were pulled from `is_email`'s extensive [test suite][tests] on October 15, 2013. Many thanks to the contributors! Additional tests have been added to increase code coverage and verify edge-cases.
|
||||
|
||||
Run any of the following.
|
||||
|
||||
```sh
|
||||
$ lab
|
||||
$ npm test
|
||||
$ make test
|
||||
```
|
||||
|
||||
_remember to_ `npm install` to get the development dependencies!
|
||||
|
||||
API
|
||||
===
|
||||
|
||||
validate(email, [options])
|
||||
--------------------------
|
||||
|
||||
Determines whether the `email` is valid or not, for various definitions thereof. Optionally accepts an `options` object. Options may include `errorLevel`.
|
||||
|
||||
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.
|
||||
|
||||
The `tldBlacklist` option can be either an object lookup table or an array of invalid top-level domains. If the email address has a top-level domain that is in the whitelist, the email will be marked as invalid.
|
||||
|
||||
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.
|
||||
|
||||
The `allowUnicode` option governs whether non-ASCII characters are allowed. Defaults to `true` per RFC 6530.
|
||||
|
||||
Only one of `tldBlacklist` and `tldWhitelist` will be consulted for TLD validity.
|
||||
|
||||
The `minDomainAtoms` option is an optional positive integer that specifies the minimum number of domain atoms that must be included for the email address to be considered valid. Be careful with the option, as some top-level domains, like `io`, directly support email addresses.
|
||||
|
||||
As of `3.1.1`, the `callback` parameter is deprecated, and will be removed in `4.0.0`.
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
$ node
|
||||
> var Isemail = require('isemail');
|
||||
undefined
|
||||
> Isemail.validate('test@iana.org');
|
||||
true
|
||||
> Isemail.validate('test@iana.123');
|
||||
true
|
||||
> Isemail.validate('test@iana.org', {errorLevel: true});
|
||||
0
|
||||
> Isemail.validate('test@iana.123', {errorLevel: true});
|
||||
10
|
||||
> Isemail.validate('test@iana.123', {errorLevel: 17});
|
||||
0
|
||||
> Isemail.validate('test@iana.123', {errorLevel: 10});
|
||||
10
|
||||
> Isemail.validate('test@iana&12');
|
||||
false
|
||||
> Isemail.validate('test@iana&12', {errorLevel: true});
|
||||
65
|
||||
> Isemail.validate('test@', {errorLevel: true});
|
||||
131
|
||||
```
|
||||
|
||||
<sup name="footnote-1">[1]</sup>: if this badge indicates the build is passing, then isemail has 100% code coverage.
|
||||
|
||||
[skeggse]: https://github.com/skeggse "Eli Skeggs"
|
||||
[tests]: http://isemail.info/_system/is_email/test/?all "is_email test suite"
|
||||
64
node_modules/isemail/lib/index.d.ts
generated
vendored
Normal file
64
node_modules/isemail/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
// Code shows a string is valid,
|
||||
// but docs require string array or object.
|
||||
type TLDList = string | string[] | { [topLevelDomain: string]: any };
|
||||
|
||||
type BaseOptions = {
|
||||
tldWhitelist?: TLDList;
|
||||
tldBlacklist?: TLDList;
|
||||
minDomainAtoms?: number;
|
||||
allowUnicode?: boolean;
|
||||
};
|
||||
|
||||
type OptionsWithBool = BaseOptions & {
|
||||
errorLevel?: false;
|
||||
};
|
||||
|
||||
type OptionsWithNumThreshold = BaseOptions & {
|
||||
errorLevel?: true | number;
|
||||
};
|
||||
|
||||
interface Validator {
|
||||
/**
|
||||
* Check that an email address conforms to RFCs 5321, 5322, 6530 and others.
|
||||
*
|
||||
* ```
|
||||
* import * as IsEmail from "isemail";
|
||||
*
|
||||
* IsEmail.validate("test@e.com");
|
||||
* // => true
|
||||
* ```
|
||||
*/
|
||||
validate(email: string): boolean;
|
||||
|
||||
/**
|
||||
* Check that an email address conforms to RFCs 5321, 5322, 6530 and others.
|
||||
*
|
||||
* ```
|
||||
* import * as IsEmail from "isemail";
|
||||
*
|
||||
* IsEmail.validate("test@iana.org", { errorLevel: false });
|
||||
* // => true
|
||||
* ```
|
||||
*/
|
||||
validate(email: string, options: OptionsWithBool): boolean;
|
||||
|
||||
/**
|
||||
* Check that an email address conforms to RFCs 5321, 5322, 6530 and others.
|
||||
*
|
||||
* ```
|
||||
* import * as IsEmail from "isemail";
|
||||
*
|
||||
* IsEmail.validate("test@iana.org", { errorLevel: true });
|
||||
* // => 0
|
||||
* IsEmail.validate("test @e.com", { errorLevel: 50 });
|
||||
* // => 0
|
||||
* IsEmail.validate('test @e.com', { errorLevel: true })
|
||||
* // => 49
|
||||
* ```
|
||||
*/
|
||||
validate(email: string, options: OptionsWithNumThreshold): number;
|
||||
}
|
||||
|
||||
declare const IsEmail: Validator;
|
||||
|
||||
export = IsEmail;
|
||||
1499
node_modules/isemail/lib/index.js
generated
vendored
Normal file
1499
node_modules/isemail/lib/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
68
node_modules/isemail/package.json
generated
vendored
Normal file
68
node_modules/isemail/package.json
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"_from": "isemail@3.x.x",
|
||||
"_id": "isemail@3.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
|
||||
"_location": "/isemail",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "isemail@3.x.x",
|
||||
"name": "isemail",
|
||||
"escapedName": "isemail",
|
||||
"rawSpec": "3.x.x",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.x.x"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/joi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
|
||||
"_shasum": "59310a021931a9fb06bbb51e155ce0b3f236832c",
|
||||
"_spec": "isemail@3.x.x",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/joi",
|
||||
"bugs": {
|
||||
"url": "https://github.com/hapijs/isemail/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"punycode": "2.x.x"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Validate an email address according to RFCs 5321, 5322, and others",
|
||||
"devDependencies": {
|
||||
"code": "^5.2.0",
|
||||
"lab": "^16.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"lib/"
|
||||
],
|
||||
"homepage": "https://github.com/hapijs/isemail#readme",
|
||||
"keywords": [
|
||||
"isemail",
|
||||
"validation",
|
||||
"check",
|
||||
"checking",
|
||||
"verification",
|
||||
"email",
|
||||
"address",
|
||||
"email address"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "lib/index.js",
|
||||
"name": "isemail",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hapijs/isemail.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "lab -a code -t 100 -L -m 5000",
|
||||
"test-cov-html": "lab -a code -r html -o coverage.html -m 5000"
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"version": "3.2.0"
|
||||
}
|
||||
Reference in New Issue
Block a user