Skip to content

Commit

Permalink
chore: fix fixed dist output, fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jun 28, 2022
1 parent d7a1eac commit 08df5d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"url": "https://github.com/niftylettuce/email-regex-safe"
},
"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"browserify": "browserify src/index.js -o dist/email-regex-safe.js -s emailRegexSafe -g [ babelify --configFile ./.dist.babelrc ]",
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
"build:clean": "rimraf lib dist",
Expand All @@ -131,10 +130,9 @@
"lint:md": "remark . -qfo",
"lint:pkg": "fixpack",
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/email-regex-safe.min.js -s emailRegexSafe -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
"nyc": "cross-env NODE_ENV=test nyc ava",
"prepare": "husky install",
"pretest": "npm run build && npm run lint",
"test": "npm run test-coverage"
"test": "cross-env NODE_ENV=test nyc ava"
},
"unpkg": "dist/email-regex-safe.min.js"
}
27 changes: 15 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ const ipv4 = ipRegex.v4().source;
const ipv6 = ipRegex.v6().source;

module.exports = (options) => {
options = {
exact: false,
strict: false,
gmail: true,
utf8: true,
localhost: true,
ipv4: true,
ipv6: false,
tlds,
returnString: false,
...options
};
// eslint-disable-next-line prefer-object-spread
options = Object.assign(
{
exact: false,
strict: false,
gmail: true,
utf8: true,
localhost: true,
ipv4: true,
ipv6: false,
tlds,
returnString: false
},
options
);

const host = '(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)';
const domain =
Expand Down

0 comments on commit 08df5d9

Please sign in to comment.