Skip to content
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

Replace utils-merge dependency with Object.assign() #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading