Skip to content

Commit 6b32200

Browse files
ctcpipPhillip9587
authored andcommitted
🐛 fix object merging
1 parent 1d3e6be commit 6b32200

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lib/generic-parser.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,9 @@ module.exports = generic
3535
*/
3636

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

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

0 commit comments

Comments
 (0)