Socket
Socket
Sign inDemoInstall

postcss-reduce-transforms

Package Overview
Dependencies
5
Maintainers
7
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.4 to 5.1.0

types/index.d.ts

8

package.json
{
"name": "postcss-reduce-transforms",
"version": "5.0.4",
"version": "5.1.0",
"description": "Reduce transform functions with PostCSS.",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"LICENSE-MIT",
"src"
"src",
"types"
],

@@ -33,3 +35,3 @@ "license": "MIT",

},
"readme": "# [postcss][postcss]-reduce-transforms\n\n> Reduce transform functions with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-reduce-transforms) do:\n\n```\nnpm install postcss-reduce-transforms --save\n```\n\n## Example\n\nThis module will reduce transform functions where possible. For more examples,\nsee the [tests](src/__tests__/index.js).\n\n### Input\n\n```css\nh1 {\n transform: rotate3d(0, 0, 1, 20deg);\n}\n```\n\n### Output\n\n```css\nh1 {\n transform: rotate(20deg);\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
"readme": "# [postcss][postcss]-reduce-transforms\n\n> Reduce transform functions with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-reduce-transforms) do:\n\n```\nnpm install postcss-reduce-transforms --save\n```\n\n## Example\n\nThis module will reduce transform functions where possible. For more examples,\nsee the [tests](src/__tests__/index.js).\n\n### Input\n\n```css\nh1 {\n transform: rotate3d(0, 0, 1, 20deg);\n}\n```\n\n### Output\n\n```css\nh1 {\n transform: rotate(20deg);\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
}

@@ -22,3 +22,3 @@ # [postcss][postcss]-reduce-transforms

h1 {
transform: rotate3d(0, 0, 1, 20deg);
transform: rotate3d(0, 0, 1, 20deg);
}

@@ -31,3 +31,3 @@ ```

h1 {
transform: rotate(20deg);
transform: rotate(20deg);
}

@@ -34,0 +34,0 @@ ```

'use strict';
const valueParser = require('postcss-value-parser');
/**
* @param {(number|string)[]} list
* @param {valueParser.Node} node
* @param {number} index
* @return {(number|string)[]}
*/
function getValues(list, node, index) {
if (index % 2 === 0) {
/** @type {number|string} */
let value = NaN;

@@ -24,2 +31,7 @@

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function matrix3d(node, values) {

@@ -69,2 +81,7 @@ if (values.length !== 16) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function rotate3d(node, values) {

@@ -84,2 +101,7 @@ if (values.length !== 4) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function rotateZ(node, values) {

@@ -94,2 +116,7 @@ if (values.length !== 1) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function scale(node, values) {

@@ -127,2 +154,7 @@ if (values.length !== 2) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function scale3d(node, values) {

@@ -161,2 +193,7 @@ if (values.length !== 3) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function translate(node, values) {

@@ -185,2 +222,7 @@ if (values.length !== 2) {

/**
* @param {valueParser.FunctionNode} node
* @param {(number|string)[]} values
* @return {void}
*/
function translate3d(node, values) {

@@ -209,3 +251,6 @@ if (values.length !== 3) {

]);
/**
* @param {string} name
* @return {string}
*/
function normalizeReducerName(name) {

@@ -221,2 +266,6 @@ const lowerCasedName = name.toLowerCase();

/**
* @param {valueParser.Node} node
* @return {false}
*/
function reduce(node) {

@@ -233,2 +282,6 @@ if (node.type === 'function') {

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

@@ -235,0 +288,0 @@ return {

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