Skip to content

Commit

Permalink
fix: ensure margin is never NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 25, 2024
1 parent 20351aa commit 2fce68a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function formatTextWithMargins({
function calculateMargins(spaces: number): {marginLeft: number; marginRight: number} {
let marginLeft: number
let marginRight: number
if (spaces <= 0) {
if (spaces <= 0 || Number.isNaN(spaces)) {
return {marginLeft: 0, marginRight: 0}
}

Expand Down

0 comments on commit 2fce68a

Please sign in to comment.