Skip to content

Commit 8d031cf

Browse files
committed
chore: drop xtend dependency
Spread in object literals is natively supported in Node.js since v8.3.0. Minimum version of Node.js supported by multer at the moment is v10.16.0, so we should be good to go.
1 parent 6bb3512 commit 8d031cf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/make-middleware.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var is = require('type-is')
22
var Busboy = require('busboy')
3-
var extend = require('xtend')
43
var appendField = require('append-field')
54

65
var Counter = require('./counter')
@@ -158,7 +157,7 @@ function makeMiddleware (setup) {
158157
storage._handleFile(req, file, function (err, info) {
159158
if (aborting) {
160159
appender.removePlaceholder(placeholder)
161-
uploadedFiles.push(extend(file, info))
160+
uploadedFiles.push({...file, ...info})
162161
return pendingWrites.decrement()
163162
}
164163

@@ -168,7 +167,7 @@ function makeMiddleware (setup) {
168167
return abortWithError(err)
169168
}
170169

171-
var fileInfo = extend(file, info)
170+
var fileInfo = {...file, ...info}
172171

173172
appender.replacePlaceholder(placeholder, fileInfo)
174173
uploadedFiles.push(fileInfo)

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"busboy": "^1.6.0",
2828
"concat-stream": "^2.0.0",
2929
"object-assign": "^4.1.1",
30-
"type-is": "^1.6.18",
31-
"xtend": "^4.0.2"
30+
"type-is": "^1.6.18"
3231
},
3332
"devDependencies": {
3433
"deep-equal": "^2.0.3",

0 commit comments

Comments
 (0)