postcss-convert-values
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -0,1 +1,7 @@ | ||
# 2.2.0 | ||
* Renames `opts.convertLength` & `opts.convertTime` to | ||
`opts.length` & `opts.time`; the old options will now print deprecation | ||
warnings (thanks to @TrySound). | ||
# 2.1.0 | ||
@@ -2,0 +8,0 @@ |
@@ -49,2 +49,10 @@ 'use strict'; | ||
opts = opts || {}; | ||
if (opts.length === undefined && opts.convertLength !== undefined) { | ||
console.warn('postcss-convert-values: `convertLength` option is deprecated. Use `length`'); | ||
opts.length = opts.convertLength; | ||
} | ||
if (opts.length === undefined && opts.convertTime !== undefined) { | ||
console.warn('postcss-convert-values: `convertTime` option is deprecated. Use `time`'); | ||
opts.time = opts.convertTime; | ||
} | ||
return function (css) { | ||
@@ -51,0 +59,0 @@ css.walkDecls(transform(opts)); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
var length = { | ||
var lengthConv = { | ||
'in': 96, | ||
@@ -14,3 +14,3 @@ 'px': 1, | ||
var time = { | ||
var timeConv = { | ||
's': 1000, | ||
@@ -60,4 +60,4 @@ 'ms': 1 | ||
exports['default'] = function (number, unit, _ref) { | ||
var convertTime = _ref.convertTime; | ||
var convertLength = _ref.convertLength; | ||
var time = _ref.time; | ||
var length = _ref.length; | ||
@@ -67,8 +67,8 @@ var value = dropLeadingZero(number) + (unit ? unit : ''); | ||
if (convertLength !== false && unit in length) { | ||
converted = transform(number, unit, length); | ||
if (length !== false && unit in lengthConv) { | ||
converted = transform(number, unit, lengthConv); | ||
} | ||
if (convertTime !== false && unit in time) { | ||
converted = transform(number, unit, time); | ||
if (time !== false && unit in timeConv) { | ||
converted = transform(number, unit, timeConv); | ||
} | ||
@@ -75,0 +75,0 @@ |
{ | ||
"name": "postcss-convert-values", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Convert values with PostCSS (e.g. ms -> s)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -46,3 +46,3 @@ # [postcss][postcss]-convert-values [![Build Status](https://travis-ci.org/ben-eb/postcss-convert-values.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-convert-values.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-convert-values.svg)][deps] | ||
##### convertLength | ||
##### length | ||
@@ -55,3 +55,3 @@ Type: `boolean` | ||
##### convertTime | ||
##### time | ||
@@ -58,0 +58,0 @@ Type: `boolean` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9282
111