Skip to content

Commit 1cdf77f

Browse files
committed
CR suggestions
1 parent 98a2706 commit 1cdf77f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/connect-react/src/utils/component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ export function integerPropErrors(opts: ValidationOpts<ConfigurablePropInteger>)
7474
} = opts
7575
const value = valueFromOption(valueOpt)
7676

77-
if (!prop.default && value == null || typeof value === "undefined") return [
77+
if (!prop.default && (value == null || typeof value === "undefined")) return [
7878
"required",
7979
]
8080

8181
const _value: number = typeof value === "number"
8282
? value
8383
: parseInt(String(value))
8484

85-
if (_value !== _value) return [
85+
if (Number.isNaN(_value)) return [
8686
"not a number",
87-
] // NaN
87+
]
8888
const errs = []
8989
if (typeof prop.min === "number" && _value < prop.min) errs.push("number too small")
9090
if (typeof prop.max === "number" && _value > prop.max) errs.push("number too big")

0 commit comments

Comments
 (0)