File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/connect-react/src/utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments