From 1a307e3ca582095a8ebd72af90f57959b1b884bd Mon Sep 17 00:00:00 2001 From: Noeri Huisman Date: Tue, 6 Feb 2024 15:18:10 +0100 Subject: [PATCH] Replace object-assign ponyfill with Object.assign --- package.json | 1 - src/utils/coordinates.js | 3 +-- src/utils/debug.js | 3 +-- src/utils/index.js | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 469674ea3fd..f0df2cb5dba 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "debug": "ngokevin/debug#noTimestamp", "deep-assign": "^2.0.0", "load-bmfont": "^1.2.3", - "object-assign": "^4.0.1", "super-animejs": "^3.1.0", "super-three": "0.161.0", "three-bmfont-text": "dmarcos/three-bmfont-text#eed4878795be9b3e38cf6aec6b903f56acd1f695", diff --git a/src/utils/coordinates.js b/src/utils/coordinates.js index 32cf35bf131..037199757b9 100644 --- a/src/utils/coordinates.js +++ b/src/utils/coordinates.js @@ -1,6 +1,5 @@ /* global THREE */ var debug = require('./debug'); -var extend = require('object-assign'); var warn = debug('utils:coordinates:warn'); @@ -45,7 +44,7 @@ function parse (value, defaultVec) { } if (value === null || value === undefined) { - return typeof defaultVec === 'object' ? extend({}, defaultVec) : defaultVec; + return typeof defaultVec === 'object' ? Object.assign({}, defaultVec) : defaultVec; } coordinate = value.trim().split(whitespaceRegex); diff --git a/src/utils/debug.js b/src/utils/debug.js index 38b1909ac58..2f1fb45aacf 100644 --- a/src/utils/debug.js +++ b/src/utils/debug.js @@ -1,5 +1,4 @@ var debugLib = require('debug'); -var extend = require('object-assign'); var settings = { colors: { @@ -22,7 +21,7 @@ var debug = function (namespace) { return d; }; -extend(debug, debugLib); +Object.assign(debug, debugLib); /** * Returns the type of the namespace (e.g., `error`, `warn`). diff --git a/src/utils/index.js b/src/utils/index.js index 06f257d8bb5..6ae912826f5 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -4,7 +4,6 @@ var debug = require('./debug'); var deepAssign = require('deep-assign'); var device = require('./device'); -var objectAssign = require('object-assign'); var objectPool = require('./object-pool'); var warn = debug('utils:warn'); @@ -158,7 +157,7 @@ module.exports.debounce = function (func, wait, immediate) { * @param {object} dest - The object to which properties will be copied. * @param {...object} source - The object(s) from which properties will be copied. */ -module.exports.extend = objectAssign; +module.exports.extend = Object.assign; module.exports.extendDeep = deepAssign; module.exports.clone = function (obj) {