Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
fix readonly property
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed May 17, 2019
1 parent 827f48f commit 426d1e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 5 additions & 8 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 426d1e9

Please sign in to comment.