UNPKG

disposable-email-domains

Version:

A list of [disposable email domains](http://en.wikipedia.org/wiki/Disposable_email_address) like `mailinator.com`. You can use it to detect or block disposable accounts in your signup process. Exact domain matches are found in [index.json](https://github.

21 lines (19 loc) 562 B
var wildcard = require('../../wildcard'); const _ = require('lodash'); /* Check if all the elements are in lowercase */ module.exports = function (chai) { chai.Assertion.addProperty('notInWildcard', function () { this._obj.forEach(domain => { if (new RegExp(/(.+(?:\.[\w-]+\.[\w-]+)+)$/).test(domain)) { wildcard.forEach(wildcard => { this.assert( ! _.endsWith(domain, wildcard) , '"' + domain + '" is already in the wildcard list' ); }) } }); }); };