Skip to content

Commit

Permalink
made is_infinity check tighter
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Jul 31, 2022
1 parent c1619c0 commit 14455f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion is_infinity.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = function is_infinity(n) {
return !!n.match(/inf(inity)?$/i);
return !!n.match(/^(|-|\+)inf(inity)?$/i);
};

0 comments on commit 14455f0

Please sign in to comment.