@tweenjs/tween.js
Advanced tools
Comparing version 16.9.0 to 16.10.0
{ | ||
"name": "@tweenjs/tween.js", | ||
"description": "Super simple, fast and easy to use tweening engine which incorporates optimised Robert Penner's equations.", | ||
"version": "16.9.0", | ||
"version": "16.10.0", | ||
"main": "src/Tween.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/tweenjs/tween.js", |
@@ -10,12 +10,4 @@ /** | ||
var TWEEN = TWEEN || {}; | ||
TWEEN._nextId = 0; | ||
TWEEN.nextId = function () { | ||
return TWEEN._nextId++; | ||
}; | ||
TWEEN.Group = function () { | ||
var _Group = function () { | ||
this._tweens = {}; | ||
@@ -25,3 +17,3 @@ this._tweensAddedDuringUpdate = {}; | ||
TWEEN.Group.prototype = assign(Object.create(Object.prototype), { | ||
_Group.prototype = { | ||
getAll: function () { | ||
@@ -89,7 +81,11 @@ | ||
} | ||
}); | ||
}; | ||
TWEEN = new _Group(); | ||
TWEEN.Group = _Group; | ||
// Create global group | ||
assignDeep(TWEEN, new TWEEN.Group()); | ||
TWEEN._nextId = 0; | ||
TWEEN.nextId = function () { | ||
return TWEEN._nextId++; | ||
}; | ||
@@ -127,30 +123,2 @@ | ||
function assign(target, source) { | ||
var keys = Object.keys(source); | ||
var length = keys.length; | ||
for (var i = 0; i < length; i += 1) { | ||
target[keys[i]] = source[keys[i]]; | ||
} | ||
return target; | ||
} | ||
function assignDeep(target, source) { | ||
// Assign own properties | ||
assign(target, source); | ||
// Assign prototype properties | ||
var targetProto = Object.getPrototypeOf(target); | ||
var sourceProto = Object.getPrototypeOf(source); | ||
for (var prop in sourceProto) { | ||
targetProto[prop] = sourceProto[prop]; | ||
} | ||
return target; | ||
} | ||
TWEEN.Tween = function (object, group) { | ||
@@ -182,3 +150,3 @@ this._object = object; | ||
TWEEN.Tween.prototype = assign(Object.create(Object.prototype), { | ||
TWEEN.Tween.prototype = { | ||
getId: function getId() { | ||
@@ -483,3 +451,3 @@ return this._id; | ||
} | ||
}); | ||
}; | ||
@@ -486,0 +454,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
31079
573