Skip to content

Commit 08df5d9

Browse files
committed
chore: fix fixed dist output, fixed tests
1 parent d7a1eac commit 08df5d9

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
"url": "https://github.com/niftylettuce/email-regex-safe"
119119
},
120120
"scripts": {
121-
"ava": "cross-env NODE_ENV=test ava",
122121
"browserify": "browserify src/index.js -o dist/email-regex-safe.js -s emailRegexSafe -g [ babelify --configFile ./.dist.babelrc ]",
123122
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
124123
"build:clean": "rimraf lib dist",
@@ -131,10 +130,9 @@
131130
"lint:md": "remark . -qfo",
132131
"lint:pkg": "fixpack",
133132
"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",
134-
"nyc": "cross-env NODE_ENV=test nyc ava",
135133
"prepare": "husky install",
136134
"pretest": "npm run build && npm run lint",
137-
"test": "npm run test-coverage"
135+
"test": "cross-env NODE_ENV=test nyc ava"
138136
},
139137
"unpkg": "dist/email-regex-safe.min.js"
140138
}

src/index.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ const ipv4 = ipRegex.v4().source;
88
const ipv6 = ipRegex.v6().source;
99

1010
module.exports = (options) => {
11-
options = {
12-
exact: false,
13-
strict: false,
14-
gmail: true,
15-
utf8: true,
16-
localhost: true,
17-
ipv4: true,
18-
ipv6: false,
19-
tlds,
20-
returnString: false,
21-
...options
22-
};
11+
// eslint-disable-next-line prefer-object-spread
12+
options = Object.assign(
13+
{
14+
exact: false,
15+
strict: false,
16+
gmail: true,
17+
utf8: true,
18+
localhost: true,
19+
ipv4: true,
20+
ipv6: false,
21+
tlds,
22+
returnString: false
23+
},
24+
options
25+
);
2326

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

0 commit comments

Comments
 (0)