Skip to content

Commit 0ed1d45

Browse files
authored
Merge pull request #580 from tweenjs/improve-types
fix: allow non-string-indexed types to be passed to Tween constructor…
2 parents 4ee0caf + 3449a13 commit 0ed1d45

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Tween.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Tween<T extends UnknownProps> {
2121
private _isPaused = false
2222
private _pauseStart = 0
2323
private _valuesStart: UnknownProps = {}
24-
private _valuesEnd: UnknownProps = {}
24+
private _valuesEnd: Record<string, number | string> = {}
2525
private _valuesStartRepeat: UnknownProps = {}
2626
private _duration = 1000
2727
private _initialRepeat = 0
@@ -477,11 +477,10 @@ export class Tween<T extends UnknownProps> {
477477

478478
private _swapEndStartRepeatValues(property: string): void {
479479
const tmp = this._valuesStartRepeat[property]
480+
const endValue = this._valuesEnd[property]
480481

481-
if (typeof this._valuesEnd[property] === 'string') {
482-
// eslint-disable-next-line
483-
// @ts-ignore FIXME?
484-
this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property])
482+
if (typeof endValue === 'string') {
483+
this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue)
485484
} else {
486485
this._valuesStartRepeat[property] = this._valuesEnd[property]
487486
}
@@ -490,6 +489,7 @@ export class Tween<T extends UnknownProps> {
490489
}
491490
}
492491

493-
export type UnknownProps = Record<string, unknown>
492+
// eslint-disable-next-line
493+
export type UnknownProps = Record<string, any>
494494

495495
export default Tween

0 commit comments

Comments
 (0)