Socket
Socket
Sign inDemoInstall

postcss-convert-values

Package Overview
Dependencies
Maintainers
1
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 1.2.0 to 1.2.1

5

CHANGELOG.md

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

# 1.2.1
* Fixes regressions introduced by the previous patch. Better support for
negative value transforms.
# 1.2.0

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

18

lib/convert.js

@@ -22,2 +22,6 @@ 'use strict';

if (value[0] === '-' && value[1] === '0' && number % 1) {
return '-' + value.substring(2);
}
return value;

@@ -27,3 +31,4 @@ }

module.exports = function (number, unit) {
var value,
var converted,
value = dropLeadingZero(number) + (unit ? unit : ''),
conversion,

@@ -39,3 +44,6 @@ base;

return Object.keys(conversion)
converted = Object.keys(conversion)
.filter(function (u) {
return unit !== u;
})
.map(function (u) {

@@ -47,5 +55,9 @@ return dropLeadingZero(base / conversion[u]) + u;

});
if (converted.length < value.length) {
value = converted;
}
}
return dropLeadingZero(number) + (unit ? unit : '');
return value;
};

2

package.json
{
"name": "postcss-convert-values",
"version": "1.2.0",
"version": "1.2.1",
"description": "Convert values with PostCSS (e.g. ms -> s)",

@@ -5,0 +5,0 @@ "main": "index.js",

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