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

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.1.0 to 1.1.1

5

CHANGELOG.md

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

# 1.1.1
* Fixes an issue where trailing zeroes were not being removed in
values that were not `0`.
# 1.1.0

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

19

index.js

@@ -23,10 +23,15 @@ 'use strict';

if (length.test(value)) {
var isZero = false;
value = value.replace(length, function (_, num, unit) {
isZero = parseFloat(num) === 0;
return converter(num, unit);
});
if (!~prop.indexOf('flex') && isZero) {
return '0';
var match = value.match(length),
num = match[1],
integer = parseInt(num),
unit = match[2];
if (parseFloat(num) === integer) {
num = integer;
}
if (num !== 0) {
num = converter(num, unit);
} else if (~prop.indexOf('flex')) {
return value;
}
return num;
}

@@ -33,0 +38,0 @@ return value;

{
"name": "postcss-convert-values",
"version": "1.1.0",
"version": "1.1.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