Skip to content

Commit 39c1249

Browse files
use one if for both positive and negative
1 parent ac9939e commit 39c1249

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/utils/src/normalize.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,8 @@ function stringifyValue(
225225
return '[NaN]';
226226
}
227227

228-
if (typeof value === 'number' && value === Infinity) {
229-
return '[Infinity]';
230-
}
231-
232-
if (typeof value === 'number' && value === -Infinity) {
233-
return '[-Infinity]';
228+
if (typeof value === 'number' && !Number.isFinite(value)) {
229+
return `[${value}]`;
234230
}
235231

236232
if (typeof value === 'function') {

0 commit comments

Comments
 (0)