🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

reduce-css-calc

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduce-css-calc - npm Package Compare versions

Comparing version

to
1.2.3

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 1.2.3 - 2016-04-28
- Fixed: wrong rouding in some edge cases
([#10](https://github.com/MoOx/reduce-css-calc/pull/10))
# 1.2.2 - 2016-04-19

@@ -2,0 +7,0 @@

5

index.js

@@ -64,2 +64,3 @@ /**

// Convert percentages to numbers, to handle expressions like: 50% * 50% (will become: 25%):
// console.log(expression)
expression = expression.replace(/\b[0-9\.]+%/g, function(percent) {

@@ -88,3 +89,5 @@ return parseFloat(percent.slice(0, -1)) * 0.01

// (0.1 * 0.2 === 0.020000000000000004)
result = Math.round(result * decimalPrecision) / decimalPrecision
if (functionIdentifier.length || unit === "%") {
result = Math.round(result * decimalPrecision) / decimalPrecision
}

@@ -91,0 +94,0 @@ // We don't need units for zero values...

2

package.json
{
"name": "reduce-css-calc",
"version": "1.2.2",
"version": "1.2.3",
"description": "Reduce CSS calc() function to the maximum",

@@ -5,0 +5,0 @@ "keywords": [