@rollup/plugin-commonjs 29.0.1 → 29.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/dist/cjs/index.js CHANGED
@@ -11,7 +11,7 @@ var estreeWalker = require('estree-walker');
11
11
  var MagicString = require('magic-string');
12
12
  var isReference = require('is-reference');
13
13
 
14
- var version = "29.0.0";
14
+ var version = "29.0.1";
15
15
  var peerDependencies = {
16
16
  rollup: "^2.68.0||^3.0.0||^4.0.0"
17
17
  };
@@ -928,6 +928,20 @@ function validateVersion(actualVersion, peerDependencyVersion, name) {
928
928
  }
929
929
  }
930
930
 
931
+ function triStateAnd(a, b) {
932
+ if (a === false) return false;
933
+ if (b === false) return false;
934
+ if (a === true && b === true) return true;
935
+ return null;
936
+ }
937
+
938
+ function triStateOr(a, b) {
939
+ if (a === true) return true;
940
+ if (b === true) return true;
941
+ if (a === false && b === false) return false;
942
+ return null;
943
+ }
944
+
931
945
  const operators = {
932
946
  '==': (x) => equals(x.left, x.right, false),
933
947
 
@@ -939,9 +953,9 @@ const operators = {
939
953
 
940
954
  '!': (x) => isFalsy(x.argument),
941
955
 
942
- '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
956
+ '&&': (x) => triStateAnd(isTruthy(x.left), isTruthy(x.right)),
943
957
 
944
- '||': (x) => isTruthy(x.left) || isTruthy(x.right)
958
+ '||': (x) => triStateOr(isTruthy(x.left), isTruthy(x.right))
945
959
  };
946
960
 
947
961
  function not(value) {
package/dist/es/index.js CHANGED
@@ -7,7 +7,7 @@ import { walk } from 'estree-walker';
7
7
  import MagicString from 'magic-string';
8
8
  import isReference from 'is-reference';
9
9
 
10
- var version = "29.0.0";
10
+ var version = "29.0.1";
11
11
  var peerDependencies = {
12
12
  rollup: "^2.68.0||^3.0.0||^4.0.0"
13
13
  };
@@ -924,6 +924,20 @@ function validateVersion(actualVersion, peerDependencyVersion, name) {
924
924
  }
925
925
  }
926
926
 
927
+ function triStateAnd(a, b) {
928
+ if (a === false) return false;
929
+ if (b === false) return false;
930
+ if (a === true && b === true) return true;
931
+ return null;
932
+ }
933
+
934
+ function triStateOr(a, b) {
935
+ if (a === true) return true;
936
+ if (b === true) return true;
937
+ if (a === false && b === false) return false;
938
+ return null;
939
+ }
940
+
927
941
  const operators = {
928
942
  '==': (x) => equals(x.left, x.right, false),
929
943
 
@@ -935,9 +949,9 @@ const operators = {
935
949
 
936
950
  '!': (x) => isFalsy(x.argument),
937
951
 
938
- '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
952
+ '&&': (x) => triStateAnd(isTruthy(x.left), isTruthy(x.right)),
939
953
 
940
- '||': (x) => isTruthy(x.left) || isTruthy(x.right)
954
+ '||': (x) => triStateOr(isTruthy(x.left), isTruthy(x.right))
941
955
  };
942
956
 
943
957
  function not(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/plugin-commonjs",
3
- "version": "29.0.1",
3
+ "version": "29.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,7 +36,8 @@
36
36
  "npm",
37
37
  "modules",
38
38
  "commonjs",
39
- "require"
39
+ "require",
40
+ "rollup-plugin"
40
41
  ],
41
42
  "peerDependencies": {
42
43
  "rollup": "^2.68.0||^3.0.0||^4.0.0"