@wuchale/svelte 0.20.4 → 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') {
@@ -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.4",
3
+ "version": "0.20.5",
4
4
  "description": "Protobuf-like i18n from plain code: Svelte adapter",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",