Socket
Socket
Sign inDemoInstall

postcss-ordered-values

Package Overview
Dependencies
Maintainers
7
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-ordered-values - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

33

dist/rules/columns.js

@@ -14,10 +14,10 @@ "use strict";

const strValues = ['auto', 'inherit', 'unset', 'initial'];
function hasUnit(value) {
const parsedVal = (0, _postcssValueParser.unit)(value);
return parsedVal && parsedVal.unit !== '';
}
const column = columns => {
let newValue = {
front: '',
back: ''
};
let shouldNormalize = false;
const widths = [];
const other = [];
columns.walk(node => {

@@ -29,18 +29,13 @@ const {

if (type === 'word' && strValues.indexOf(value.toLowerCase())) {
const parsedVal = (0, _postcssValueParser.unit)(value);
if (parsedVal.unit !== '') {
// surely its the column's width
// it needs to be at the front
newValue.front = `${newValue.front} ${value}`;
shouldNormalize = true;
if (type === 'word') {
if (hasUnit(value)) {
widths.push(value);
} else {
other.push(value);
}
} else if (type === 'word') {
newValue.back = `${newValue.back} ${value}`;
}
});
}); // only transform if declaration is not invalid or a single value
if (shouldNormalize) {
return `${newValue.front.trimStart()} ${newValue.back.trimStart()}`;
if (other.length === 1 && widths.length === 1) {
return `${widths[0].trimStart()} ${other[0].trimStart()}`;
}

@@ -47,0 +42,0 @@

{
"name": "postcss-ordered-values",
"version": "5.0.1",
"version": "5.0.2",
"description": "Ensure values are ordered consistently in your CSS.",

@@ -11,5 +11,5 @@ "main": "dist/index.js",

"scripts": {
"prebuild": "del-cli dist",
"prebuild": "rimraf dist",
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\" && node script/buildListStyleType.js",
"prepublish": "yarn build"
"prepare": "yarn build"
},

@@ -46,3 +46,3 @@ "keywords": [

},
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc"
"gitHead": "39b4cc089e8825d308df1fa8a7313d38d8f1f2f7"
}
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