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.5 to 5.1.0

types/index.d.ts

8

package.json
{
"name": "postcss-ordered-values",
"version": "5.0.5",
"version": "5.1.0",
"description": "Ensure values are ordered consistently in your CSS.",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"src",
"LICENSE-MIT"
"LICENSE-MIT",
"types"
],

@@ -24,3 +26,3 @@ "keywords": [

"dependencies": {
"cssnano-utils": "^3.0.2",
"cssnano-utils": "^3.1.0",
"postcss-value-parser": "^4.2.0"

@@ -27,0 +29,0 @@ },

@@ -19,2 +19,3 @@ 'use strict';

/** @type {[string, (parsed: valueParser.ParsedValue) => string][]} */
const borderRules = [

@@ -34,2 +35,3 @@ ['border', border],

/** @type {[string, (parsed: valueParser.ParsedValue) => string | string[] | valueParser.ParsedValue][]} */
const grid = [

@@ -47,2 +49,3 @@ ['grid-auto-flow', normalizeGridAutoFlow],

/** @type {[string, (parsed: valueParser.ParsedValue) => string | valueParser.ParsedValue][]} */
const columnRules = [

@@ -53,2 +56,3 @@ ['column-rule', border],

/** @type {Map<string, ((parsed: valueParser.ParsedValue) => string | string[] | valueParser.ParsedValue)>} */
const rules = new Map([

@@ -66,2 +70,6 @@ ['animation', animation],

/**
* @param {valueParser.Node} node
* @return {boolean}
*/
function isVariableFunctionNode(node) {

@@ -75,2 +83,6 @@ if (node.type !== 'function') {

/**
* @param {valueParser.ParsedValue} parsed
* @return {boolean}
*/
function shouldAbort(parsed) {

@@ -94,2 +106,6 @@ let abort = false;

/**
* @param {import('postcss').Declaration} decl
* @return {string}
*/
function getValue(decl) {

@@ -104,3 +120,6 @@ let { value, raws } = decl;

}
/**
* @type {import('postcss').PluginCreator<void>}
* @return {import('postcss').Plugin}
*/
function pluginCreator() {

@@ -107,0 +126,0 @@ return {

'use strict';
/** @return {import('postcss-value-parser').SpaceNode} */
module.exports = function addSpace() {
return { type: 'space', value: ' ' };
return /** @type import('postcss-value-parser').SpaceNode */ ({
type: 'space',
value: ' ',
});
};

@@ -16,2 +16,3 @@ 'use strict';

function flatten(values) {
/** @type {import('postcss-value-parser').Node[]} */
const nodes = [];

@@ -18,0 +19,0 @@ for (const [index, arg] of values.entries()) {

'use strict';
/**
* @param {string[]} grid
* @return {string}
*/
module.exports = function joinGridVal(grid) {
return grid.join(' / ').trim();
};
'use strict';
/**
* @param {string} prop
* @return {string}
*/
function vendorUnprefixed(prop) {

@@ -3,0 +7,0 @@ return prop.replace(/^-\w+-/, '');

@@ -29,18 +29,35 @@ 'use strict';

/**
* @param {string} value
* @param {string} type
* @return {boolean}
*/
const isTimingFunction = (value, type) => {
return (type === 'function' && functions.has(value)) || keywords.has(value);
};
/**
* @param {string} value
* @return {boolean}
*/
const isDirection = (value) => {
return directions.has(value);
};
/**
* @param {string} value
* @return {boolean}
*/
const isFillMode = (value) => {
return fillModes.has(value);
};
/**
* @param {string} value
* @return {boolean}
*/
const isPlayState = (value) => {
return playStates.has(value);
};
/**
* @param {string} value
* @return {boolean}
*/
const isTime = (value) => {

@@ -51,3 +68,6 @@ const quantity = unit(value);

};
/**
* @param {string} value
* @return {boolean}
*/
const isIterationCount = (value) => {

@@ -76,2 +96,3 @@ const quantity = unit(value);

for (const arg of args) {
/** @type {Record<string, import('postcss-value-parser').Node[]>} */
const state = {

@@ -78,0 +99,0 @@ name: [],

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

/**
* @param {import('postcss-value-parser').ParsedValue} border
* @return {string}
*/
module.exports = function normalizeBorder(border) {

@@ -26,0 +30,0 @@ const order = { width: '', style: '', color: '' };

@@ -34,3 +34,5 @@ 'use strict';

for (const arg of args) {
/** @type {import('postcss-value-parser').Node[]} */
let val = [];
/** @type {Record<'inset'|'color', import('postcss-value-parser').Node[]>} */
let state = {

@@ -37,0 +39,0 @@ inset: [],

'use strict';
const { unit } = require('postcss-value-parser');
/**
* @param {string} value
* @return {boolean}
*/
function hasUnit(value) {

@@ -9,4 +13,10 @@ const parsedVal = unit(value);

/**
* @param {import('postcss-value-parser').ParsedValue} columns
* @return {import('postcss-value-parser').ParsedValue | string}
*/
module.exports = (columns) => {
/** @type {string[]} */
const widths = [];
/** @type {string[]} */
const other = [];

@@ -13,0 +23,0 @@ columns.walk((node) => {

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

/**
* @param {import('postcss-value-parser').ParsedValue} flexFlow
* @return {string}
*/
module.exports = function normalizeFlexFlow(flexFlow) {

@@ -15,0 +19,0 @@ let order = {

'use strict';
const joinGridValue = require('../lib/joinGridValue');
/**
* @param {import('postcss-value-parser').ParsedValue} gridAutoFlow
* @return {import('postcss-value-parser').ParsedValue | string}
*/
const normalizeGridAutoFlow = (gridAutoFlow) => {

@@ -24,2 +28,6 @@ let newValue = { front: '', back: '' };

/**
* @param {import('postcss-value-parser').ParsedValue} gridGap
* @return {import('postcss-value-parser').ParsedValue | string}
*/
const normalizeGridColumnRowGap = (gridGap) => {

@@ -43,2 +51,6 @@ let newValue = { front: '', back: '' };

/**
* @param {import('postcss-value-parser').ParsedValue} grid
* @return {string | string[]}
*/
const normalizeGridColumnRow = (grid) => {

@@ -45,0 +57,0 @@ // cant do normalization here using node, so copy it as a string

@@ -8,2 +8,7 @@ 'use strict';

const definedPosition = new Set(['inside', 'outside']);
/**
* @param {import('postcss-value-parser').ParsedValue} listStyle
* @return {string}
*/
module.exports = function listStyleNormalizer(listStyle) {

@@ -10,0 +15,0 @@ const order = { type: '', position: '', image: '' };

@@ -26,2 +26,3 @@ 'use strict';

for (const arg of args) {
/** @type {Record<string, import('postcss-value-parser').Node[]>} */
let state = {

@@ -28,0 +29,0 @@ timingFunction: [],

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