Skip to content

Commit

Permalink
Replace utils-merge dependency with Object.assign()
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Oct 27, 2024
1 parent 878b0e0 commit 108deaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ unreleased
* Remove `Object.setPrototypeOf` polyfill
* Use `Array.flat` instead of `array-flatten` package
* Replace `methods` dependency with standard library
* Replace `utils-merge` dependency with `Object.assign`

2.0.0 / 2024-09-09
==================
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
const isPromise = require('is-promise')
const Layer = require('./lib/layer')
const methods = require('methods')
const mixin = require('utils-merge')
const parseUrl = require('parseurl')
const Route = require('./lib/route')

Expand Down Expand Up @@ -526,11 +525,11 @@ function mergeParams (params, parent) {
}

// make copy of parent for base
const obj = mixin({}, parent)
const obj = Object.assign({}, parent)

// simple non-numeric merging
if (!(0 in params) || !(0 in parent)) {
return mixin(obj, params)
return Object.assign(obj, params)
}

let i = 0
Expand All @@ -556,7 +555,7 @@ function mergeParams (params, parent) {
}
}

return mixin(obj, params)
return Object.assign(obj, params)
}

/**
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"dependencies": {
"is-promise": "4.0.0",
"parseurl": "~1.3.3",
"path-to-regexp": "^8.0.0",
"utils-merge": "1.0.1"
"path-to-regexp": "^8.0.0"
},
"devDependencies": {
"after": "0.8.2",
Expand Down

0 comments on commit 108deaf

Please sign in to comment.