Skip to content

Commit

Permalink
use one if for both positive and negative
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Aug 27, 2024
1 parent ac9939e commit 39c1249
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/utils/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,8 @@ function stringifyValue(
return '[NaN]';
}

if (typeof value === 'number' && value === Infinity) {
return '[Infinity]';
}

if (typeof value === 'number' && value === -Infinity) {
return '[-Infinity]';
if (typeof value === 'number' && !Number.isFinite(value)) {
return `[${value}]`;
}

if (typeof value === 'function') {
Expand Down

0 comments on commit 39c1249

Please sign in to comment.