Socket
Socket
Sign inDemoInstall

postcss-ordered-values

Package Overview
Dependencies
6
Maintainers
7
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.2 to 5.0.3

dist/lib/mathfunctions.js

24

dist/index.js

@@ -24,4 +24,6 @@ "use strict";

var _columns = require("./rules/columns");
var _columns = _interopRequireDefault(require("./rules/columns"));
var _vendorUnprefixed = _interopRequireDefault(require("./lib/vendorUnprefixed.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -63,4 +65,4 @@

const columnRules = {
'column-rule': _columns.columnsRule,
columns: _columns.column
'column-rule': _border.default,
columns: _columns.default
};

@@ -79,6 +81,2 @@ const rules = {

function vendorUnprefixed(prop) {
return prop.replace(/^-\w+-/, '');
}
function isVariableFunctionNode(node) {

@@ -121,3 +119,3 @@ if (node.type !== 'function') {

prepare() {
const cache = {};
const cache = new Map();
return {

@@ -127,3 +125,3 @@ OnceExit(css) {

const lowerCasedProp = decl.prop.toLowerCase();
const normalizedProp = vendorUnprefixed(lowerCasedProp);
const normalizedProp = (0, _vendorUnprefixed.default)(lowerCasedProp);
const processor = rules[normalizedProp];

@@ -137,4 +135,4 @@

if (cache[value]) {
decl.value = cache[value];
if (cache.has(value)) {
decl.value = cache.get(value);
return;

@@ -146,3 +144,3 @@ }

if (parsed.nodes.length < 2 || shouldAbort(parsed)) {
cache[value] = value;
cache.set(value, value);
return;

@@ -153,3 +151,3 @@ }

decl.value = result.toString();
cache[value] = result.toString();
cache.set(value, result.toString());
});

@@ -156,0 +154,0 @@ }

@@ -10,2 +10,6 @@ "use strict";

var _mathfunctions = _interopRequireDefault(require("../lib/mathfunctions.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// border: <line-width> || <line-style> || <color>

@@ -30,3 +34,3 @@ // outline: <outline-color> || <outline-style> || <outline-width>

if (type === 'word') {
if (~borderStyles.indexOf(value.toLowerCase())) {
if (borderStyles.includes(value.toLowerCase())) {
order.style = value;

@@ -36,3 +40,3 @@ return false;

if (~borderWidths.indexOf(value.toLowerCase()) || (0, _postcssValueParser.unit)(value.toLowerCase())) {
if (borderWidths.includes(value.toLowerCase()) || (0, _postcssValueParser.unit)(value.toLowerCase())) {
if (order.width !== '') {

@@ -52,3 +56,3 @@ order.width = `${order.width} ${value}`;

if (type === 'function') {
if (value.toLowerCase() === 'calc') {
if (_mathfunctions.default.includes(value.toLowerCase())) {
order.width = (0, _postcssValueParser.stringify)(node);

@@ -55,0 +59,0 @@ } else {

@@ -16,2 +16,6 @@ "use strict";

var _mathfunctions = _interopRequireDefault(require("../lib/mathfunctions.js"));
var _vendorUnprefixed = _interopRequireDefault(require("../lib/vendorUnprefixed.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -35,3 +39,3 @@

if (type === 'function' && ~value.toLowerCase().indexOf('calc')) {
if (type === 'function' && _mathfunctions.default.includes((0, _vendorUnprefixed.default)(value.toLowerCase()))) {
abort = true;

@@ -38,0 +42,0 @@ return;

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

});
exports.columnsRule = exports.column = void 0;
exports.default = void 0;
var _postcssValueParser = require("postcss-value-parser");
var _border = _interopRequireDefault(require("./border.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function hasUnit(value) {

@@ -20,3 +16,3 @@ const parsedVal = (0, _postcssValueParser.unit)(value);

const column = columns => {
var _default = columns => {
const widths = [];

@@ -46,4 +42,3 @@ const other = [];

exports.column = column;
const columnsRule = _border.default;
exports.columnsRule = columnsRule;
exports.default = _default;
module.exports = exports.default;

@@ -6,3 +6,3 @@ "use strict";

});
exports.normalizeGridColumnRow = exports.normalizeGridColumnRowGap = exports.normalizeGridAutoFlow = void 0;
exports.normalizeGridColumnRowGap = exports.normalizeGridColumnRow = exports.normalizeGridAutoFlow = void 0;

@@ -9,0 +9,0 @@ var _joinGridValue = _interopRequireDefault(require("../lib/joinGridValue"));

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

@@ -10,7 +10,2 @@ "main": "dist/index.js",

],
"scripts": {
"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",
"prepare": "yarn build"
},
"keywords": [

@@ -30,4 +25,4 @@ "css",

"dependencies": {
"cssnano-utils": "^2.0.1",
"postcss-value-parser": "^4.1.0"
"cssnano-utils": "^3.0.0",
"postcss-value-parser": "^4.2.0"
},

@@ -47,3 +42,7 @@ "bugs": {

},
"gitHead": "39b4cc089e8825d308df1fa8a7313d38d8f1f2f7"
}
"scripts": {
"prebuild": "rimraf dist",
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\" && node script/buildListStyleType.js"
},
"readme": "# [postcss][postcss]-ordered-values\n\n> Ensure values are ordered consistently in your CSS.\n\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-ordered-values) do:\n\n```\nnpm install postcss-ordered-values --save\n```\n\n\n## Example\n\nSome CSS properties accept their values in an arbitrary order; for this reason,\nit is entirely possible that different developers will write their values in\ndifferent orders. This module normalizes the order, making it easier for other\nmodules to understand which declarations are duplicates.\n\n### Input\n\n```css\nh1 {\n border: solid 1px red;\n border: red solid .5em;\n border: rgba(0, 30, 105, 0.8) solid 1px;\n border: 1px solid red;\n}\n```\n\n### Output\n\n```css\nh1 {\n border: 1px solid red;\n border: .5em solid red;\n border: 1px solid rgba(0, 30, 105, 0.8);\n border: 1px solid red;\n}\n```\n\n\n## Support List\n\nFor more examples, see the [tests](src/__tests__/index.js).\n\n* `animation`, `-webkit-animation`\n* `border(border-left|right|top|bottom)`\n* `box-shadow`\n* `outline`\n* `flex-flow`\n* `transition`, `-webkit-transition`\n\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc