Skip to content

Commit 56c2838

Browse files
authored
replace deepmerge with @fastify/deepmerge (#363)
1 parent 23c56a8 commit 56c2838

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const hexoid = require('hexoid')
1111
const util = require('util')
1212
const createError = require('@fastify/error')
1313
const sendToWormhole = require('stream-wormhole')
14-
const deepmerge = require('deepmerge')
14+
const deepmergeAll = require('@fastify/deepmerge')({ all: true })
1515
const { PassThrough, pipeline } = require('stream')
1616
const pump = util.promisify(pipeline)
1717
const secureJSON = require('secure-json-parse')
@@ -237,7 +237,7 @@ function fastifyMultipart (fastify, options, done) {
237237

238238
const req = this.raw
239239

240-
const busboyOptions = deepmerge.all([{ headers: Object.assign({}, req.headers) }, options || {}, opts || {}])
240+
const busboyOptions = deepmergeAll({ headers: req.headers }, options || {}, opts || {})
241241
const stream = busboy(busboyOptions)
242242
let completed = false
243243
let files = 0
@@ -330,11 +330,11 @@ function fastifyMultipart (fastify, options, done) {
330330
let lastError = null
331331
let currentFile = null
332332
const request = this.raw
333-
const busboyOptions = deepmerge.all([
334-
{ headers: Object.assign({}, request.headers) },
333+
const busboyOptions = deepmergeAll(
334+
{ headers: request.headers },
335335
options,
336336
opts
337-
])
337+
)
338338

339339
this.log.trace({ busboyOptions }, 'Providing options to busboy')
340340
const bb = busboy(busboyOptions)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"types": "index.d.ts",
77
"dependencies": {
88
"@fastify/busboy": "^1.0.0",
9+
"@fastify/deepmerge": "^1.0.0",
910
"@fastify/error": "^3.0.0",
10-
"deepmerge": "^4.2.2",
1111
"end-of-stream": "^1.4.4",
1212
"fastify-plugin": "^3.0.0",
1313
"hexoid": "^1.0.0",

0 commit comments

Comments
 (0)