🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

reserved-email-addresses-list

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reserved-email-addresses-list - npm Package Compare versions

Comparing version

to
0.0.6

2

package.json
{
"name": "reserved-email-addresses-list",
"description": "List of 1250+ email addresses reserved for security concerns",
"version": "0.0.5",
"version": "0.0.6",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

@@ -6,0 +6,0 @@ "bugs": {

@@ -29,3 +29,3 @@ # reserved-email-addresses-list

```sh
npm install reserved-email-addresses-list
npm install reserved-email-addresses-list validator
```

@@ -36,3 +36,3 @@

```sh
yarn add reserved-email-addresses-list
yarn add reserved-email-addresses-list validator
```

@@ -43,3 +43,3 @@

The string you are comparing with must be converted to lowercase, trimmed of whitespace, and strictly converted to alphanumeric characters only.
The string you are comparing with must be converted to lowercase and trimmed of whitespace. The reason we are converting to lowercase is because the dictionary of words we are comparing with are all lowercase, and in order to compare for strict equality, we must have matching case.

@@ -49,7 +49,9 @@ It is also highly recommended that you check for strict equality, and for a list of admin-related usernames, you should check for strict equality, starts with, or ends with comparisons as well.

```js
const reservedEmailAddressesList = require('reserved-email-addresses-list');
const reservedAdminList = require('reserved-email-addresses-list/admin-list.json');
const email = 'Admin***!!!@example.com';
const str = 'Admin***!!!'.toLowerCase().replace(/[^0-9a-z]/g, '');
if (!validator.isEmail(email))
throw new Error('Email was not a valid address');
const str = email.split('@')[0].toLowerCase();
let reservedMatch = reservedEmailAddressesList.find(addr => addr === str);

@@ -64,7 +66,4 @@

throw new Error(
`User must be a domain admin to create an alias with a reserved word (see the page on <a target="_blank" rel="noopener" href="${config.urls.web}/reserved-email-addresses">Reserved Email Addresses</a>).`
'User must be a domain admin to create an alias with a reserved word (see https://forwardemail.net/reserved-email-addresses).'
);
if (reservedMatch)
throw new Error(`${str} matched a reserved email address of ${match}`);
```

@@ -75,3 +74,3 @@

See [index.json](<>) for the complete list of all reserved email addresses.
See [index.json](index.json) for the complete list of all reserved email addresses, and [admin-list.json](admin-list.json) for the list of all reserved admin names.

@@ -78,0 +77,0 @@