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 1.2.2 to 1.2.3

5

CHANGELOG.md

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

# 1.2.3
* Adds support for `ch` units; previously they were removed.
* Upgrades css-list to `0.1.0`, code tidied up.
# 1.2.2

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

5

index.js

@@ -11,6 +11,9 @@ 'use strict';

css.eachDecl(function (decl) {
if (~decl.prop.indexOf('flex')) {
return;
}
decl.value = eachValue(decl.value, function (value) {
var number, unit;
if (!~decl.prop.indexOf('flex') && !isNaN(number = parseFloat(value))) {
if (!isNaN(number = parseFloat(value))) {
unit = parseUnit(value);

@@ -17,0 +20,0 @@

2

lib/eachValue.js

@@ -7,3 +7,3 @@ 'use strict';

module.exports = function eachValue (value, callback) {
return list.map(value, [' ', '\n', '\t', ',', '/'], function (value, type) {
return list.map(value, function (value, type) {
var name,

@@ -10,0 +10,0 @@ match,

'use strict';
// From longer to shorter!
var units = ['vmin', 'vmax', 'rem', 'em', 'ex', 'vw', 'vh', 'vm', 'in', 'cm', 'mm', 'pt', 'pc', 'px', 'ms', 's', '%'];
var units = [
'vmin',
'vmax',
'rem',
'em',
'ex',
'vw',
'vh',
'vm',
'ch',
'in',
'cm',
'mm',
'pt',
'pc',
'px',
'ms',
's',
'%'
];

@@ -11,3 +30,3 @@ module.exports = function (value) {

index = units.indexOf(value.slice(-max));
if (index !== -1) {
if (~index) {
return units[index];

@@ -14,0 +33,0 @@ }

{
"name": "postcss-convert-values",
"version": "1.2.2",
"version": "1.2.3",
"description": "Convert values with PostCSS (e.g. ms -> s)",

@@ -18,4 +18,4 @@ "main": "index.js",

"devDependencies": {
"tap-spec": "^2.2.2",
"tape": "^3.5.0"
"tap-spec": "^4.0.2",
"tape": "^4.0.0"
},

@@ -31,5 +31,5 @@ "homepage": "https://github.com/ben-eb/postcss-convert-values",

"balanced-match": "^0.2.0",
"css-list": "0.0.3",
"postcss": "^4.1.4"
"css-list": "^0.1.0",
"postcss": "^4.1.13"
}
}
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