postcss-normalize-timing-functions 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
@@ -39,6 +39,6 @@ See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTOR
39
39
 
40
40
  ## License
41
41
 
42
- MIT © [Ben Briggs](http://beneb.info)
42
+ MIT © [Ben Briggs](https://beneb.info)
43
43
 
44
44
  [postcss]: https://github.com/postcss/postcss
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "postcss-normalize-timing-functions",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "Normalize CSS animation/transition timing functions.",
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",
@@ -16,9 +24,12 @@
16
24
  "author": {
17
25
  "name": "Ben Briggs",
18
26
  "email": "beneb.info@gmail.com",
19
- "url": "http://beneb.info"
27
+ "url": "https://beneb.info"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "cssnano/cssnano"
20
32
  },
21
- "repository": "cssnano/cssnano",
22
33
  "bugs": {
23
34
  "url": "https://github.com/cssnano/cssnano/issues"
24
35
  },
@@ -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
@@ -3,6 +3,8 @@ const valueParser = require('postcss-value-parser');
3
3
 
4
4
  /** @type {(node: valueParser.Node) => number} */
5
5
  const getValue = (node) => parseFloat(node.value);
6
+ const animationTransitionRegex =
7
+ /^(-\w+-)?(animation|transition)(-timing-function)?$/i;
6
8
 
7
9
  /* Works because toString() normalizes the formatting,
8
10
  so comparing the string forms behaves the same as number equality*/
@@ -111,36 +113,36 @@ function transform(value) {
111
113
  }
112
114
 
113
115
  /**
114
- * @type {import('postcss').PluginCreator<void>}
115
116
  * @return {import('postcss').Plugin}
116
117
  */
117
118
  function pluginCreator() {
118
119
  return {
119
120
  postcssPlugin: 'postcss-normalize-timing-functions',
120
-
121
+ /**
122
+ * @param {import('postcss').Root} css
123
+ */
121
124
  OnceExit(css) {
122
125
  const cache = new Map();
123
126
 
124
- css.walkDecls(
125
- /^(-\w+-)?(animation|transition)(-timing-function)?$/i,
126
- (decl) => {
127
- const value = decl.value;
127
+ css.walkDecls(animationTransitionRegex, (decl) => {
128
+ const value = decl.value;
128
129
 
129
- if (cache.has(value)) {
130
- decl.value = cache.get(value);
130
+ if (cache.has(value)) {
131
+ decl.value = cache.get(value);
131
132
 
132
- return;
133
- }
133
+ return;
134
+ }
134
135
 
135
- const result = transform(value);
136
+ const result = transform(value);
136
137
 
137
- decl.value = result;
138
- cache.set(value, result);
139
- }
140
- );
138
+ decl.value = result;
139
+ cache.set(value, result);
140
+ });
141
141
  },
142
142
  };
143
143
  }
144
144
 
145
145
  pluginCreator.postcss = true;
146
- module.exports = pluginCreator;
146
+ module.exports = /** @type {import('postcss').PluginCreator<void>}*/ (
147
+ pluginCreator
148
+ );
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":";AAgHA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CA4BnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}