From 8c8a434d08877f27a4552dad7f71ef93a63e4aa7 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Sun, 27 Oct 2024 18:22:18 +0100 Subject: [PATCH] Replace `utils-merge` dependency with `Object.assign()` Signed-off-by: Jon Koops --- HISTORY.md | 1 + index.js | 7 +++---- package.json | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 5f69004..349d8b8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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 ================== diff --git a/index.js b/index.js index b806282..7746b64 100644 --- a/index.js +++ b/index.js @@ -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') @@ -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 @@ -556,7 +555,7 @@ function mergeParams (params, parent) { } } - return mixin(obj, params) + return Object.assign(obj, params) } /** diff --git a/package.json b/package.json index cbbba3b..48f5c8a 100644 --- a/package.json +++ b/package.json @@ -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",