Skip to content

replace deepmerge with @fastify/deepmerge #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hexoid = require('hexoid')
const util = require('util')
const createError = require('@fastify/error')
const sendToWormhole = require('stream-wormhole')
const deepmerge = require('deepmerge')
const deepmergeAll = require('@fastify/deepmerge')({ all: true })
const { PassThrough, pipeline } = require('stream')
const pump = util.promisify(pipeline)
const secureJSON = require('secure-json-parse')
Expand Down Expand Up @@ -237,7 +237,7 @@ function fastifyMultipart (fastify, options, done) {

const req = this.raw

const busboyOptions = deepmerge.all([{ headers: Object.assign({}, req.headers) }, options || {}, opts || {}])
const busboyOptions = deepmergeAll({ headers: req.headers }, options || {}, opts || {})
const stream = busboy(busboyOptions)
let completed = false
let files = 0
Expand Down Expand Up @@ -330,11 +330,11 @@ function fastifyMultipart (fastify, options, done) {
let lastError = null
let currentFile = null
const request = this.raw
const busboyOptions = deepmerge.all([
{ headers: Object.assign({}, request.headers) },
const busboyOptions = deepmergeAll(
{ headers: request.headers },
options,
opts
])
)

this.log.trace({ busboyOptions }, 'Providing options to busboy')
const bb = busboy(busboyOptions)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"types": "index.d.ts",
"dependencies": {
"@fastify/busboy": "^1.0.0",
"@fastify/deepmerge": "^1.0.0",
"@fastify/error": "^3.0.0",
"deepmerge": "^4.2.2",
"end-of-stream": "^1.4.4",
"fastify-plugin": "^3.0.0",
"hexoid": "^1.0.0",
Expand Down