Skip to content

Commit

Permalink
check isNaN in isNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka committed Oct 6, 2022
1 parent 47c5f51 commit 214f4b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/utils/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
* @param arg
*/
export const isNumber = <T>(arg: T): boolean => {
return typeof arg === 'number';
return typeof arg === 'number'
&& !Number.isNaN(arg);
};

0 comments on commit 214f4b8

Please sign in to comment.