@tbela99/css-parser 1.6.2 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ # v1.6.3
4
+
5
+ ## Fix
6
+ - [x] fix infinity rendering as 1/0 instead of 0/0 (NaN)
7
+
8
+ ```css
9
+
10
+ @media (min-width: 300px) and (max-width: 768px){
11
+ .s {
12
+
13
+ margin-left: calc(infinity + 1 + calc(infinity - 1 + calc(infinity / 1 + calc(infinity * 1))));
14
+ margin-right: calc(infinity + 1px + calc(infinity - 1 + calc(infinity / 1 + calc(infinity * 1))));
15
+
16
+ }
17
+
18
+ ```
19
+ is parsed as
20
+
21
+ ```css
22
+ @media (300px<=width<=768px) {
23
+ .s {
24
+ margin-left: calc(1/0);
25
+ margin-right: calc(1/0 + 1px)
26
+ }
27
+ }
28
+ ```
29
+
3
30
  # v1.6.2
4
31
 
5
32
  ## Fix
@@ -26327,9 +26327,9 @@
26327
26327
  ? renderValue(token.val, options, cache)
26328
26328
  : minifyNumber(token.val);
26329
26329
  case exports.EnumToken.InfinityTokenType:
26330
- return "0/0";
26330
+ return "1/0";
26331
26331
  case exports.EnumToken.NegativeInfinityTokenType:
26332
- return "-0/0";
26332
+ return "-1/0";
26333
26333
  case exports.EnumToken.NaNTokenType:
26334
26334
  return "NaN";
26335
26335
  case exports.EnumToken.AtRuleTokenType:
package/dist/index.cjs CHANGED
@@ -26330,9 +26330,9 @@ function renderValue(token, options = {}, cache = Object.create(null), reducer,
26330
26330
  ? renderValue(token.val, options, cache)
26331
26331
  : minifyNumber(token.val);
26332
26332
  case exports.EnumToken.InfinityTokenType:
26333
- return "0/0";
26333
+ return "1/0";
26334
26334
  case exports.EnumToken.NegativeInfinityTokenType:
26335
- return "-0/0";
26335
+ return "-1/0";
26336
26336
  case exports.EnumToken.NaNTokenType:
26337
26337
  return "NaN";
26338
26338
  case exports.EnumToken.AtRuleTokenType:
@@ -1255,9 +1255,9 @@ function renderValue(token, options = {}, cache = Object.create(null), reducer,
1255
1255
  ? renderValue(token.val, options, cache)
1256
1256
  : minifyNumber(token.val);
1257
1257
  case EnumToken.InfinityTokenType:
1258
- return "0/0";
1258
+ return "1/0";
1259
1259
  case EnumToken.NegativeInfinityTokenType:
1260
- return "-0/0";
1260
+ return "-1/0";
1261
1261
  case EnumToken.NaNTokenType:
1262
1262
  return "NaN";
1263
1263
  case EnumToken.AtRuleTokenType:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tbela99/css-parser",
3
3
  "description": "CSS parser, minifier and validator for node and the browser",
4
- "version": "1.6.2",
4
+ "version": "1.6.3",
5
5
  "exports": {
6
6
  ".": "./dist/node.js",
7
7
  "./node": "./dist/node.js",