Skip to content

Commit

Permalink
check for Inf
Browse files Browse the repository at this point in the history
  • Loading branch information
gtm-nayan committed Jul 21, 2022
1 parent b776868 commit 6780d98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/page/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function is_serializable_primitive(v) {
v == null ||
typeof v === 'boolean' ||
typeof v === 'string' ||
(typeof v === 'number' && !isNaN(v)) // JSON.stringify(NaN) === null
(typeof v === 'number' && !isNaN(v) && isFinite(v)) // NaN or Infinity turns into null when stringified
);
}

Expand Down

0 comments on commit 6780d98

Please sign in to comment.