@esportsplus/reactivity 0.29.7 → 0.29.9

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.
@@ -152,9 +152,6 @@ export default (sourceFile, bindings) => {
152
152
  sourceFile
153
153
  };
154
154
  visit(ctx, sourceFile);
155
- if (ctx.calls.length === 0) {
156
- return { prepend: [], replacements: [] };
157
- }
158
155
  let prepend = [], replacements = [];
159
156
  for (let i = 0, n = ctx.calls.length; i < n; i++) {
160
157
  let call = ctx.calls[i];
@@ -35,8 +35,14 @@ function visit(ctx, node) {
35
35
  if (ts.isArrowFunction(arg) || ts.isFunctionExpression(arg)) {
36
36
  classification = TYPES.Computed;
37
37
  }
38
- else if (ts.isArrayLiteralExpression(arg) || ts.isObjectLiteralExpression(arg)) {
39
- classification = null;
38
+ else {
39
+ let unwrapped = arg;
40
+ while (ts.isAsExpression(unwrapped) || ts.isParenthesizedExpression(unwrapped) || ts.isTypeAssertionExpression(unwrapped)) {
41
+ unwrapped = unwrapped.expression;
42
+ }
43
+ if (ts.isArrayLiteralExpression(unwrapped) || ts.isObjectLiteralExpression(unwrapped)) {
44
+ classification = null;
45
+ }
40
46
  }
41
47
  if (classification) {
42
48
  let varname = null;
package/package.json CHANGED
@@ -13,6 +13,10 @@
13
13
  "types": "./build/index.d.ts",
14
14
  "default": "./build/index.js"
15
15
  },
16
+ "./compiler": {
17
+ "types": "./build/compiler/index.d.ts",
18
+ "default": "./build/compiler/index.js"
19
+ },
16
20
  "./compiler/tsc": {
17
21
  "types": "./build/compiler/plugins/tsc.d.ts",
18
22
  "default": "./build/compiler/plugins/tsc.js"
@@ -31,7 +35,7 @@
31
35
  },
32
36
  "type": "module",
33
37
  "types": "build/index.d.ts",
34
- "version": "0.29.7",
38
+ "version": "0.29.9",
35
39
  "scripts": {
36
40
  "build": "tsc",
37
41
  "build:test": "pnpm build && vite build --config test/vite.config.ts",
@@ -229,10 +229,6 @@ export default (sourceFile: ts.SourceFile, bindings: Bindings): ObjectTransformR
229
229
 
230
230
  visit(ctx, sourceFile);
231
231
 
232
- if (ctx.calls.length === 0) {
233
- return { prepend: [], replacements: [] };
234
- }
235
-
236
232
  let prepend: string[] = [],
237
233
  replacements: ReplacementIntent[] = [];
238
234
 
@@ -64,8 +64,16 @@ function visit(ctx: TransformContext, node: ts.Node): void {
64
64
  if (ts.isArrowFunction(arg) || ts.isFunctionExpression(arg)) {
65
65
  classification = TYPES.Computed;
66
66
  }
67
- else if (ts.isArrayLiteralExpression(arg) || ts.isObjectLiteralExpression(arg)) {
68
- classification = null;
67
+ else {
68
+ let unwrapped = arg;
69
+
70
+ while (ts.isAsExpression(unwrapped) || ts.isParenthesizedExpression(unwrapped) || ts.isTypeAssertionExpression(unwrapped)) {
71
+ unwrapped = unwrapped.expression;
72
+ }
73
+
74
+ if (ts.isArrayLiteralExpression(unwrapped) || ts.isObjectLiteralExpression(unwrapped)) {
75
+ classification = null;
76
+ }
69
77
  }
70
78
 
71
79
  if (classification) {