@rollup/plugin-commonjs 29.0.1 → 29.0.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/README.md CHANGED
@@ -334,7 +334,7 @@ For these situations, you can change Rollup's behaviour either globally or per m
334
334
  var isInstance = false;
335
335
  try {
336
336
  isInstance = this instanceof a;
337
- } catch {}
337
+ } catch (e) {}
338
338
  if (isInstance) {
339
339
  return Reflect.construct(f, arguments, this.constructor);
340
340
  }
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.2";
15
15
  var peerDependencies = {
16
16
  rollup: "^2.68.0||^3.0.0||^4.0.0"
17
17
  };
@@ -383,7 +383,7 @@ export function getAugmentedNamespace(n) {
383
383
  var isInstance = false;
384
384
  try {
385
385
  isInstance = this instanceof a;
386
- } catch {}
386
+ } catch (e) {}
387
387
  if (isInstance) {
388
388
  return Reflect.construct(f, arguments, this.constructor);
389
389
  }
@@ -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.2";
11
11
  var peerDependencies = {
12
12
  rollup: "^2.68.0||^3.0.0||^4.0.0"
13
13
  };
@@ -379,7 +379,7 @@ export function getAugmentedNamespace(n) {
379
379
  var isInstance = false;
380
380
  try {
381
381
  isInstance = this instanceof a;
382
- } catch {}
382
+ } catch (e) {}
383
383
  if (isInstance) {
384
384
  return Reflect.construct(f, arguments, this.constructor);
385
385
  }
@@ -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.3",
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"
@@ -66,26 +67,17 @@
66
67
  "typescript": "^4.8.3"
67
68
  },
68
69
  "types": "./types/index.d.ts",
69
- "ava": {
70
- "workerThreads": false,
71
- "files": [
72
- "!**/fixtures/**",
73
- "!**/helpers/**",
74
- "!**/recipes/**",
75
- "!**/types.ts"
76
- ]
77
- },
78
70
  "scripts": {
79
71
  "build": "rollup -c",
80
72
  "ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
81
73
  "ci:lint": "pnpm build && pnpm lint",
82
74
  "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
83
- "ci:test": "pnpm test -- --verbose && pnpm test:ts",
75
+ "ci:test": "pnpm test -- --reporter=verbose && pnpm test:ts",
84
76
  "prebuild": "del-cli dist",
85
77
  "prerelease": "pnpm build",
86
78
  "pretest": "pnpm build",
87
79
  "release": "pnpm --workspace-root package:release $(pwd)",
88
- "test": "ava",
80
+ "test": "vitest --config ../../.config/vitest.config.mts run",
89
81
  "test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
90
82
  }
91
83
  }