@wuchale/svelte 0.20.3 → 0.20.5

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.
@@ -41,8 +41,8 @@ export class SvelteTransformer extends Transformer {
41
41
  if (msg.details.leftSide) {
42
42
  return false;
43
43
  }
44
- const topCall = msg.details.topLevelCall ?? '';
45
- if (noWrapTopCalls.includes(topCall) || noWrapTopCalls.some(c => topCall.startsWith(`${c}.`))) {
44
+ const call = msg.details.topLevelCall ?? msg.details.call ?? '';
45
+ if (noWrapTopCalls.includes(call) || noWrapTopCalls.some(c => call.startsWith(`${c}.`))) {
46
46
  return false;
47
47
  }
48
48
  if (msg.details.declaring !== 'variable') {
@@ -178,7 +178,7 @@ export class SvelteTransformer extends Transformer {
178
178
  return this.visitSv(value);
179
179
  }
180
180
  heuDetails.scope = 'attribute';
181
- const [pass, msgInfo] = this.checkHeuristic(value.data, heuDetails);
181
+ const [pass, msgInfo] = this.checkHeuristicAllowNew(value.data, heuDetails);
182
182
  if (!pass) {
183
183
  return [];
184
184
  }
@@ -208,7 +208,7 @@ export class SvelteTransformer extends Transformer {
208
208
  return this.visit(node.expression);
209
209
  }
210
210
  visitOnDirective(node) {
211
- return this.visit(node.expression);
211
+ return node.expression ? this.visit(node.expression) : [];
212
212
  }
213
213
  hasIdentifier(node, name) {
214
214
  if (!node || typeof node !== 'object') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wuchale/svelte",
3
- "version": "0.20.3",
3
+ "version": "0.20.5",
4
4
  "description": "Protobuf-like i18n from plain code: Svelte adapter",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",
@@ -54,7 +54,7 @@
54
54
  "svelte": "^5"
55
55
  },
56
56
  "dependencies": {
57
- "wuchale": "^0.25.4"
57
+ "wuchale": "^0.25.6"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "~24.13.2",