Skip to content

Commit

Permalink
Use Number instead of parseInt (#6593)
Browse files Browse the repository at this point in the history
## Summary
Replace `parseInt` with `Number`, as the second function correctly
handles empty string and undefined.
```
Number(null) = 0
Number('') = 0
parseInt(null) = NaN
```

## Test plan
  • Loading branch information
Latropos authored Oct 15, 2024
1 parent 608a909 commit e9b6187
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class InnerKeyframe implements IEntryExitAnimationBuilder {
const duration: number = this.durationV ? this.durationV : 500;
const animationKeyPoints: Array<number> = Array.from(
Object.keys(this.definitions)
).map(parseInt);
).map(Number);

const getAnimationDuration = (
key: string,
Expand Down

0 comments on commit e9b6187

Please sign in to comment.