Skip to content

Commit

Permalink
fix for checkAndEvaluateMath as it currently crashed on boolean expre…
Browse files Browse the repository at this point in the history
…ssions
  • Loading branch information
thomasmattheussen committed Aug 1, 2023
1 parent bad0d46 commit 4e05c17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/checkAndEvaluateMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function parseAndReduce(expr: string): string {
return expr;
}
// Put back the px unit if needed and if reduced doesn't come with one
return `${typeof evaluated !== 'string' ? Number.parseFloat(evaluated.toFixed(3)) : evaluated}${
return `${typeof evaluated === 'number' ? Number.parseFloat(evaluated.toFixed(3)) : evaluated}${
unit ?? (hasPx ? 'px' : '')
}`;
}
Expand Down

0 comments on commit 4e05c17

Please sign in to comment.