Skip to content

Commit fcb95e7

Browse files
remove any from getEffectiveSpeed
The finalSpeed is a number, so no need to the safe guard
1 parent 5af3bd5 commit fcb95e7

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/ts-default/Components/PixelCard/PixelCard.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,17 @@ class Pixel {
102102
}
103103
}
104104

105-
function getEffectiveSpeed(value: any, reducedMotion: any) {
105+
function getEffectiveSpeed(value: number, reducedMotion: boolean) {
106106
const min = 0;
107107
const max = 100;
108108
const throttle = 0.001;
109-
const parsed = parseInt(value, 10);
110109

111-
if (parsed <= min || reducedMotion) {
110+
if (value <= min || reducedMotion) {
112111
return min;
113-
} else if (parsed >= max) {
112+
} else if (value >= max) {
114113
return max * throttle;
115114
} else {
116-
return parsed * throttle;
115+
return value * throttle;
117116
}
118117
}
119118

src/ts-tailwind/Components/PixelCard/PixelCard.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,17 @@ class Pixel {
101101
}
102102
}
103103

104-
function getEffectiveSpeed(value: any, reducedMotion: any) {
104+
function getEffectiveSpeed(value: number, reducedMotion: boolean) {
105105
const min = 0;
106106
const max = 100;
107107
const throttle = 0.001;
108-
const parsed = parseInt(value, 10);
109108

110-
if (parsed <= min || reducedMotion) {
109+
if (value <= min || reducedMotion) {
111110
return min;
112-
} else if (parsed >= max) {
111+
} else if (value >= max) {
113112
return max * throttle;
114113
} else {
115-
return parsed * throttle;
114+
return value * throttle;
116115
}
117116
}
118117

0 commit comments

Comments
 (0)