Skip to content

Commit 806a0c6

Browse files
committed
🐛 fix object merging
1 parent 7016193 commit 806a0c6

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lib/generic-parser.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,9 @@ module.exports = generic
3434
*/
3535

3636
function generic (parserOptions, parserOverrides) {
37-
var opts = {}
38-
3937
// Squash the options and the overrides down into one object
40-
var squashKey
41-
for (squashKey in (parserOptions || {})) {
42-
if (Object.prototype.hasOwnProperty.call(parserOptions, squashKey)) {
43-
opts[squashKey] = parserOptions[squashKey]
44-
}
45-
}
46-
for (squashKey in (parserOverrides || {})) {
47-
if (Object.prototype.hasOwnProperty.call(parserOverrides, squashKey)) {
48-
opts[squashKey] = parserOverrides[squashKey]
49-
}
50-
}
38+
var opts = Object.create(parserOptions)
39+
Object.assign(opts, parserOverrides)
5140

5241
var limit = typeof opts.limit !== 'number'
5342
? bytes.parse(opts.limit || '100kb')

0 commit comments

Comments
 (0)