Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-convert-values

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-convert-values - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

6

CHANGELOG.md

@@ -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));

16

dist/lib/convert.js

@@ -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`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc