Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
chore: remove needless typeof
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed May 16, 2019
1 parent 7c26b9c commit 08c7bcf
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,8 @@ function refine(props, searchState, nextRefinement, currentRange, context) {
const nextMinAsNumber = !isMinReset ? parseFloat(nextMin) : undefined;
const nextMaxAsNumber = !isMaxReset ? parseFloat(nextMax) : undefined;

const isNextMinValid =
isMinReset ||
(typeof nextMinAsNumber === 'number' && isFinite(nextMinAsNumber));
const isNextMaxValid =
isMaxReset ||
(typeof nextMaxAsNumber === 'number' && isFinite(nextMaxAsNumber));
const isNextMinValid = isMinReset || isFinite(nextMinAsNumber);
const isNextMaxValid = isMaxReset || isFinite(nextMaxAsNumber);

if (!isNextMinValid || !isNextMaxValid) {
throw Error("You can't provide non finite values to the range connector.");
Expand Down

0 comments on commit 08c7bcf

Please sign in to comment.