postcss-reduce-transforms 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE-MIT CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
1
+ Copyright (c) Ben Briggs <beneb.info@gmail.com> (https://beneb.info)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
package/README.md CHANGED
@@ -42,6 +42,6 @@ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTOR
42
42
 
43
43
  ## License
44
44
 
45
- MIT © [Ben Briggs](http://beneb.info)
45
+ MIT © [Ben Briggs](https://beneb.info)
46
46
 
47
47
  [postcss]: https://github.com/postcss/postcss
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "postcss-reduce-transforms",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "Reduce transform functions with PostCSS.",
5
- "main": "src/index.js",
6
- "types": "types/index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./types/index.d.ts",
8
+ "default": "./src/index.js"
9
+ },
10
+ "./src": "./src/index.js",
11
+ "./src/index": "./src/index.js",
12
+ "./src/index.js": "./src/index.js",
13
+ "./package.json": "./package.json"
14
+ },
7
15
  "files": [
8
16
  "LICENSE-MIT",
9
17
  "src",
@@ -14,9 +22,12 @@
14
22
  "author": {
15
23
  "name": "Ben Briggs",
16
24
  "email": "beneb.info@gmail.com",
17
- "url": "http://beneb.info"
25
+ "url": "https://beneb.info"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "cssnano/cssnano"
18
30
  },
19
- "repository": "cssnano/cssnano",
20
31
  "dependencies": {
21
32
  "postcss-value-parser": "^4.2.0"
22
33
  },
@@ -27,9 +38,9 @@
27
38
  "node": "^22.11.0 || ^24.11.0 || >=26.0"
28
39
  },
29
40
  "devDependencies": {
30
- "postcss": "^8.5.15"
41
+ "postcss": "^8.5.25"
31
42
  },
32
43
  "peerDependencies": {
33
- "postcss": "^8.5.15"
44
+ "postcss": "^8.5.25"
34
45
  }
35
46
  }
package/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  const valueParser = require('postcss-value-parser');
3
3
 
4
+ const transformRegex = /transform$/i;
4
5
  /**
5
6
  * @param {(number|string)[]} list
6
7
  * @param {valueParser.Node} node
@@ -142,8 +143,6 @@ function scale(node, values) {
142
143
  if (first === 1) {
143
144
  node.value = 'scaleY';
144
145
  node.nodes = [nodes[2]];
145
-
146
- return;
147
146
  }
148
147
  }
149
148
 
@@ -180,8 +179,6 @@ function scale3d(node, values) {
180
179
  if (first === 1 && second === 1) {
181
180
  node.value = 'scaleZ';
182
181
  node.nodes = [nodes[4]];
183
-
184
- return;
185
182
  }
186
183
  }
187
184
 
@@ -208,8 +205,6 @@ function translate(node, values) {
208
205
  if (values[0] === 0) {
209
206
  node.value = 'translateY';
210
207
  node.nodes = [nodes[2]];
211
-
212
- return;
213
208
  }
214
209
  }
215
210
 
@@ -271,7 +266,6 @@ function reduce(node) {
271
266
  }
272
267
 
273
268
  /**
274
- * @type {import('postcss').PluginCreator<void>}
275
269
  * @return {import('postcss').Plugin}
276
270
  */
277
271
  function pluginCreator() {
@@ -280,8 +274,11 @@ function pluginCreator() {
280
274
  prepare() {
281
275
  const cache = new Map();
282
276
  return {
277
+ /**
278
+ * @param {import('postcss').Root} css
279
+ */
283
280
  OnceExit(css) {
284
- css.walkDecls(/transform$/i, (decl) => {
281
+ css.walkDecls(transformRegex, (decl) => {
285
282
  const value = decl.value;
286
283
 
287
284
  if (!value) {
@@ -306,4 +303,6 @@ function pluginCreator() {
306
303
  }
307
304
 
308
305
  pluginCreator.postcss = true;
309
- module.exports = pluginCreator;
306
+ module.exports = /** @type {import('postcss').PluginCreator<void>} */ (
307
+ pluginCreator
308
+ );
package/types/index.d.ts CHANGED
@@ -1,10 +1,3 @@
1
- export = pluginCreator;
2
- /**
3
- * @type {import('postcss').PluginCreator<void>}
4
- * @return {import('postcss').Plugin}
5
- */
6
- declare function pluginCreator(): import("postcss").Plugin;
7
- declare namespace pluginCreator {
8
- let postcss: true;
9
- }
1
+ declare const _exports: import("postcss").PluginCreator<void>;
2
+ export = _exports;
10
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAgRA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CA+BnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}