Skip to content

Commit 8eb0bc8

Browse files
committed
chore: reformat
1 parent 87d57ef commit 8eb0bc8

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": true
4+
}

src/lib/reducer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@ function includesNoCssProperties(node) {
361361
* @return {import('../parser').CalcNode}
362362
*/
363363
function reduce(node, precision) {
364-
if (node.type === 'MathExpression' && (node.left.type === 'CalcKeyword' || node.right.type === 'CalcKeyword')) {
364+
if (
365+
node.type === 'MathExpression' &&
366+
(node.left.type === 'CalcKeyword' || node.right.type === 'CalcKeyword')
367+
) {
365368
return node;
366369
}
367370
if (node.type === 'MathExpression') {

src/lib/stringifier.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ module.exports = function (calc, node, originalValue, options, result, item) {
7979
let str = stringify(node, options.precision);
8080

8181
const shouldPrintCalc =
82-
node.type === 'MathExpression' || node.type === 'Function' ||
83-
node.type === 'ParenthesizedExpression' || node.type === 'CalcKeyword';
82+
node.type === 'MathExpression' ||
83+
node.type === 'Function' ||
84+
node.type === 'ParenthesizedExpression' ||
85+
node.type === 'CalcKeyword';
8486

8587
if (shouldPrintCalc) {
8688
// if calc expression couldn't be resolved to a single value, re-wrap it as

src/parser.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ export interface CalcKeywordExpression {
7575

7676
export type ValueExpression = DimensionExpression | NumberExpression;
7777

78-
export type CalcNode = MathExpression | ValueExpression | FunctionExpression | ParenthesizedExpression | CalcKeywordExpression;
78+
export type CalcNode =
79+
| MathExpression
80+
| ValueExpression
81+
| FunctionExpression
82+
| ParenthesizedExpression
83+
| CalcKeywordExpression;
7984

8085
export interface Parser {
8186
parse: (arg: string) => CalcNode;

0 commit comments

Comments
 (0)