mirror of
https://github.com/peakoss/anti-slop
synced 2026-11-28 13:37:41 +08:00
refactor(input): switch to Number.isNaN to avoid type coercion
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -141,7 +141,7 @@ export function getSettings(): Settings {
|
||||
}
|
||||
|
||||
function validateNumber(value: number, name: string, min: number, max: number): void {
|
||||
if (isNaN(value)) {
|
||||
if (Number.isNaN(value)) {
|
||||
throw new Error(`"${name}" must be a valid number`);
|
||||
}
|
||||
if (value < min || value > max) {
|
||||
|
||||
Reference in new issue
Block a user