Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
reset(isActive?: boolean, goal?: string) {
if (goal) {
this._toString = createInterpolator({
output: [this.getValue(), goal],
})
}
this._value = 0
super.reset(isActive)
}
}
constructor(from: string, to: string) {
super(0)
this._toString = createInterpolator({ output: [from, to] })
}
static create(from: T, to: T | null = from): AnimatedValue {
if (is.str(from) && is.str(to)) {
return new AnimatedString(from, to) as any
}
throw TypeError('Expected "from" and "to" to be strings')
}
setValue(value: Value) {
if (!is.num(value)) {
this._string = value
this._value = 1
} else if (super.setValue(value)) {
this._string = null
} else {
return false
}
return true
}