From 4524c20b48abe08e69c25a7382a289592d147496 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 13 Jan 2021 17:26:33 +0100 Subject: update dependencies, apply new linter fixes --- src/types/Box.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/types/Box.js') diff --git a/src/types/Box.js b/src/types/Box.js index 71d1e2a..f8976d4 100644 --- a/src/types/Box.js +++ b/src/types/Box.js @@ -34,13 +34,18 @@ export default class Box { } init (source) { - var base = [ 0, 0, 0, 0 ] - source = typeof source === 'string' ? source.split(delimiter).map(parseFloat) - : Array.isArray(source) ? source - : typeof source === 'object' ? [ source.left != null ? source.left - : source.x, source.top != null ? source.top : source.y, source.width, source.height ] - : arguments.length === 4 ? [].slice.call(arguments) - : base + const base = [ 0, 0, 0, 0 ] + source = typeof source === 'string' + ? source.split(delimiter).map(parseFloat) + : Array.isArray(source) + ? source + : typeof source === 'object' + ? [ source.left != null + ? source.left + : source.x, source.top != null ? source.top : source.y, source.width, source.height ] + : arguments.length === 4 + ? [].slice.call(arguments) + : base this.x = source[0] || 0 this.y = source[1] || 0 -- cgit v1.2.3