Skip to content

Commit c83777e

Browse files
committed
Remove leading zero addition as they are correctly handled.
Closes #15. Closes #16.
1 parent 7e55aea commit c83777e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

index.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ function reduceCSSCalc(value, decimalPrecision) {
3232
stack = 0
3333
decimalPrecision = Math.pow(10, decimalPrecision === undefined ? 5 : decimalPrecision)
3434

35-
value = value
36-
// CSS allow to omit 0 for 0.* values,
37-
// but math-expression-evaluator does not
38-
.replace(/(\s|\()(\.[0-9])/g, "$10$2")
39-
40-
// allow calc() on multiple lines
41-
.replace(/\n+/g, " ")
35+
// Allow calc() on multiple lines
36+
value = value.replace(/\n+/g, " ")
4237

4338
/**
4439
* Evaluates an expression

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"dependencies": {
1717
"balanced-match": "^0.1.0",
18-
"math-expression-evaluator": "^1.2.9",
18+
"math-expression-evaluator": "^1.2.14",
1919
"reduce-function-call": "^1.0.1"
2020
},
2121
"devDependencies": {

0 commit comments

Comments
 (0)