diff --git a/package.json b/package.json index fd10165..dc8701b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es6-tween", - "version": "5.5.6", + "version": "5.5.7", "description": "ES6 implementation of amazing tween.js", "browser": "bundled/Tween.min.js", "cdn": "bundled/Tween.min.js", diff --git a/src/constants.js b/src/constants.js index 9b6492f..61da124 100644 --- a/src/constants.js +++ b/src/constants.js @@ -59,16 +59,13 @@ const hex2rgb = (all, hex) => { } export function decomposeString (fromValue) { - if (fromValue && fromValue.splice && fromValue.isString) { + if (typeof fromValue !== 'string' || (fromValue && fromValue.splice && fromValue.isString)) { return fromValue } - const value = - typeof fromValue !== 'string' - ? fromValue - : fromValue - .replace(hexColor, hex2rgb) - .match(NUM_REGEX) - .map((v) => (isNaNForST(v) ? v : +v)) + const value = fromValue + .replace(hexColor, hex2rgb) + .match(NUM_REGEX) + .map((v) => (isNaNForST(v) ? v : +v)) value.isString = true return value }