Skip to content

Commit

Permalink
Replace object-assign ponyfill with Object.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
mrxz committed Feb 6, 2024
1 parent 9b22aba commit 1a307e3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/utils/coordinates.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global THREE */
var debug = require('./debug');
var extend = require('object-assign');

var warn = debug('utils:coordinates:warn');

Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/utils/debug.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var debugLib = require('debug');
var extend = require('object-assign');

var settings = {
colors: {
Expand All @@ -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`).
Expand Down
3 changes: 1 addition & 2 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1a307e3

Please sign in to comment.