reduce-css-calc
Advanced tools
Comparing version
@@ -0,28 +1,34 @@ | ||
# 1.2.1 - 2016-02-22 | ||
- Fixed: uppercase letters in units are now supported | ||
([#8](https://github.com/MoOx/reduce-css-calc/pull/8)) | ||
# 1.2.0 - 2014-11-24 | ||
* Decimal precision is now customisable as the `precision` option | ||
- Decimal precision is now customisable as the `precision` option | ||
# 1.1.4 - 2014-11-12 | ||
* 5 decimals rounding for everything | ||
- 5 decimals rounding for everything | ||
# 1.1.3 - 2014-08-13 | ||
* 5 decimals rounding for percentage | ||
- 5 decimals rounding for percentage | ||
# 1.1.2 - 2014-08-10 | ||
* Prevent infinite loop by adding a `Call stack overflow` | ||
* Correctly ignore unrecognized values (safer evaluation for nested expressions, see [postcss/postcss-calc#2](https://github.com/postcss/postcss-calc/issues/2)) | ||
* Handle rounding issues (eg: 10% * 20% now give 2%, not 2.0000000000000004%) | ||
- Prevent infinite loop by adding a `Call stack overflow` | ||
- Correctly ignore unrecognized values (safer evaluation for nested expressions, | ||
see [postcss/postcss-calc#2](https://github.com/postcss/postcss-calc/issues/2)) | ||
- Handle rounding issues (eg: 10% * 20% now give 2%, not 2.0000000000000004%) | ||
# 1.1.1 - 2014-08-06 | ||
* Fix issue when using mutiples differents prefixes in the same function | ||
- Fix issue when using mutiples differents prefixes in the same function | ||
# 1.1.0 - 2014-08-06 | ||
* support more complex formulas | ||
* use `reduce-function-call` | ||
* better error message | ||
- support more complex formulas | ||
- use `reduce-function-call` | ||
- better error message | ||
@@ -29,0 +35,0 @@ |
@@ -69,3 +69,3 @@ /** | ||
// Remove units in expression: | ||
var toEvaluate = expression.replace(new RegExp(unit, "g"), "") | ||
var toEvaluate = expression.replace(new RegExp(unit, "gi"), "") | ||
var result | ||
@@ -138,3 +138,4 @@ | ||
var uniqueUnits = [] | ||
var unitRegEx = /[\.0-9]([%a-z]+)/g | ||
var uniqueLowerCaseUnits = [] | ||
var unitRegEx = /[\.0-9]([%a-z]+)/gi | ||
var matches = unitRegEx.exec(expression) | ||
@@ -147,4 +148,5 @@ | ||
if (uniqueUnits.indexOf(matches[1]) === -1) { | ||
if (uniqueLowerCaseUnits.indexOf(matches[1].toLowerCase()) === -1) { | ||
uniqueUnits.push(matches[1]) | ||
uniqueLowerCaseUnits.push(matches[1].toLowerCase()) | ||
} | ||
@@ -151,0 +153,0 @@ |
{ | ||
"name": "reduce-css-calc", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Reduce CSS calc() function to the maximum", | ||
@@ -12,9 +12,4 @@ "keywords": [ | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/MoOx/reduce-css-calc.git" | ||
}, | ||
"repository": "https://github.com/MoOx/reduce-css-calc.git", | ||
"files": [ | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"index.js" | ||
@@ -29,2 +24,3 @@ ], | ||
"jshint": "^2.5.2", | ||
"npmpub": "^3.0.3", | ||
"tape": "^2.13.4" | ||
@@ -35,4 +31,5 @@ }, | ||
"jshint": "jshint . --exclude node_modules", | ||
"test": "npm run jscs && npm run jshint && tape test" | ||
"test": "npm run jscs && npm run jshint && tape test", | ||
"release": "npmpub" | ||
} | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8244
2.86%126
1.61%4
33.33%1
Infinity%