Skip to content

Commit

Permalink
update dependencies, apply new linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuzzyma committed Jan 13, 2021
1 parent 4f4dc2a commit 4524c20
Show file tree
Hide file tree
Showing 40 changed files with 5,998 additions and 2,871 deletions.
7,969 changes: 5,512 additions & 2,457 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions package.json
Expand Up @@ -77,44 +77,44 @@
"checkTests": "node spec/checkForAllTests.js"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/plugin-external-helpers": "^7.8.3",
"@babel/plugin-transform-classes": "^7.9.5",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/polyfill": "^7.8.7",
"@babel/preset-env": "^7.9.6",
"@babel/runtime": "^7.9.6",
"@babel/runtime-corejs3": "^7.9.6",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-multi-entry": "^3.0.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"@babel/core": "^7.12.10",
"@babel/plugin-external-helpers": "^7.12.1",
"@babel/plugin-transform-classes": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.12.11",
"@babel/runtime": "^7.12.5",
"@babel/runtime-corejs3": "^7.12.5",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@target/custom-event-polyfill": "github:Adobe-Marketing-Cloud/custom-event-polyfill",
"babel-eslint": "^10.1.0",
"core-js": "^3.6.5",
"core-js": "^3.8.2",
"coveralls": "^3.1.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint": "^7.17.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sort-class-members": "^1.7.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-sort-class-members": "^1.9.0",
"eslint-plugin-standard": "^5.0.0",
"esm": "^3.2.25",
"http-server": "^0.12.3",
"jasmine": "^3.5.0",
"jasmine-core": "^3.5.0",
"karma": "^5.0.5",
"jasmine": "^3.6.3",
"jasmine-core": "^3.6.0",
"karma": "^5.2.3",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.2",
"karma-firefox-launcher": "^1.3.0",
"karma-jasmine": "^3.1.1",
"karma-sauce-launcher": "^4.1.4",
"rollup": "^2.9.0",
"rollup-plugin-filesize": "^8.0.2",
"rollup-plugin-terser": "^5.3.0",
"typescript": "^3.8.3",
"yargs": "^15.3.1",
"karma-coverage": "^2.0.3",
"karma-firefox-launcher": "^2.1.0",
"karma-jasmine": "^4.0.1",
"karma-sauce-launcher": "^4.3.4",
"rollup": "^2.36.1",
"rollup-plugin-filesize": "^9.1.0",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.1.3",
"yargs": "^16.2.0",
"svgdom": "^0.1.8"
},
"browserslist": [
Expand Down
18 changes: 9 additions & 9 deletions src/animation/Animator.js
Expand Up @@ -11,7 +11,7 @@ const Animator = {

frame (fn) {
// Store the node
var node = Animator.frames.push({ run: fn })
const node = Animator.frames.push({ run: fn })

// Request an animation frame if we don't have one
if (Animator.nextDraw === null) {
Expand All @@ -26,10 +26,10 @@ const Animator = {
delay = delay || 0

// Work out when the event should fire
var time = Animator.timer().now() + delay
const time = Animator.timer().now() + delay

// Add the timeout to the end of the queue
var node = Animator.timeouts.push({ run: fn, time: time })
const node = Animator.timeouts.push({ run: fn, time: time })

// Request another animation frame if we need one
if (Animator.nextDraw === null) {
Expand All @@ -41,7 +41,7 @@ const Animator = {

immediate (fn) {
// Add the immediate fn to the end of the queue
var node = Animator.immediates.push(fn)
const node = Animator.immediates.push(fn)
// Request another animation frame if we need one
if (Animator.nextDraw === null) {
Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)
Expand All @@ -65,8 +65,8 @@ const Animator = {
_draw (now) {
// Run all the timeouts we can run, if they are not ready yet, add them
// to the end of the queue immediately! (bad timeouts!!! [sarcasm])
var nextTimeout = null
var lastTimeout = Animator.timeouts.last()
let nextTimeout = null
const lastTimeout = Animator.timeouts.last()
while ((nextTimeout = Animator.timeouts.shift())) {
// Run the timeout if its time, or push it to the end
if (now >= nextTimeout.time) {
Expand All @@ -80,13 +80,13 @@ const Animator = {
}

// Run all of the animation frames
var nextFrame = null
var lastFrame = Animator.frames.last()
let nextFrame = null
const lastFrame = Animator.frames.last()
while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {
nextFrame.run(now)
}

var nextImmediate = null
let nextImmediate = null
while ((nextImmediate = Animator.immediates.shift())) {
nextImmediate()
}
Expand Down
28 changes: 14 additions & 14 deletions src/animation/Controller.js
Expand Up @@ -140,15 +140,15 @@ export class Controller extends Stepper {

function recalculate () {
// Apply the default parameters
var duration = (this._duration || 500) / 1000
var overshoot = this._overshoot || 0
const duration = (this._duration || 500) / 1000
const overshoot = this._overshoot || 0

// Calculate the PID natural response
var eps = 1e-10
var pi = Math.PI
var os = Math.log(overshoot / 100 + eps)
var zeta = -os / Math.sqrt(pi * pi + os * os)
var wn = 3.9 / (zeta * duration)
const eps = 1e-10
const pi = Math.PI
const os = Math.log(overshoot / 100 + eps)
const zeta = -os / Math.sqrt(pi * pi + os * os)
const wn = 3.9 / (zeta * duration)

// Calculate the Spring values
this.d = 2 * zeta * wn
Expand All @@ -173,11 +173,11 @@ export class Spring extends Controller {
dt /= 1000

// Get the previous velocity
var velocity = c.velocity || 0
const velocity = c.velocity || 0

// Apply the control to get the new position and store it
var acceleration = -this.d * velocity - this.k * (current - target)
var newPosition = current
const acceleration = -this.d * velocity - this.k * (current - target)
const newPosition = current
+ velocity * dt
+ acceleration * dt * dt / 2

Expand Down Expand Up @@ -208,10 +208,10 @@ export class PID extends Controller {
if (dt === Infinity) return target
if (dt === 0) return current

var p = target - current
var i = (c.integral || 0) + p * dt
var d = (p - (c.error || 0)) / dt
var windup = this._windup
const p = target - current
let i = (c.integral || 0) + p * dt
const d = (p - (c.error || 0)) / dt
const windup = this._windup

// antiwindup
if (windup !== false) {
Expand Down
30 changes: 17 additions & 13 deletions src/animation/Morphable.js
Expand Up @@ -50,7 +50,7 @@ export default class Morphable {
}

at (pos) {
var _this = this
const _this = this

return this._morphObj.fromArray(
this._from.map(function (i, index) {
Expand All @@ -60,7 +60,7 @@ export default class Morphable {
}

done () {
var complete = this._context
const complete = this._context
.map(this._stepper.done)
.reduce(function (last, curr) {
return last && curr
Expand Down Expand Up @@ -108,17 +108,21 @@ export default class Morphable {
this.type(getClassForType(value))
}

var result = (new this._type(value))
let result = (new this._type(value))
if (this._type === Color) {
result = this._to ? result[this._to[4]]()
: this._from ? result[this._from[4]]()
: result
result = this._to
? result[this._to[4]]()
: this._from
? result[this._from[4]]()
: result
}

if (this._type === ObjectBag) {
result = this._to ? result.align(this._to)
: this._from ? result.align(this._from)
: result
result = this._to
? result.align(this._to)
: this._from
? result.align(this._from)
: result
}

result = result.toArray()
Expand Down Expand Up @@ -181,7 +185,7 @@ export class TransformBag {
}

toArray () {
var v = this
const v = this

return [
v.scaleX,
Expand Down Expand Up @@ -236,7 +240,7 @@ export class ObjectBag {
}

objOrArr = objOrArr || {}
var entries = []
const entries = []

for (const i in objOrArr) {
const Type = getClassForType(objOrArr[i])
Expand All @@ -255,8 +259,8 @@ export class ObjectBag {
}

valueOf () {
var obj = {}
var arr = this.values
const obj = {}
const arr = this.values

// for (var i = 0, len = arr.length; i < len; i += 2) {
while (arr.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/animation/Queue.js
Expand Up @@ -16,7 +16,7 @@ export default class Queue {

push (value) {
// An item stores an id and the provided value
var item = typeof value.next !== 'undefined' ? value : { value: value, next: null, prev: null }
const item = typeof value.next !== 'undefined' ? value : { value: value, next: null, prev: null }

// Deal with the queue being empty or populated
if (this._last) {
Expand Down Expand Up @@ -47,7 +47,7 @@ export default class Queue {

shift () {
// Check if we have a value
var remove = this._first
const remove = this._first
if (!remove) return null

// If we do, remove it and relink things
Expand Down

0 comments on commit 4524c20

Please sign in to comment.