babel-plugin-vasille 4.3.1 → 4.3.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.
Files changed (2) hide show
  1. package/lib/expression.js +12 -8
  2. package/package.json +1 -1
package/lib/expression.js CHANGED
@@ -377,16 +377,20 @@ function checkExpression(nodePath, search) {
377
377
  case "ObjectExpression": {
378
378
  const path = nodePath;
379
379
  for (const propPath of path.get("properties")) {
380
- const prop = propPath.node;
381
- if (t.isObjectProperty(prop)) {
382
- const path = propPath;
383
- const valuePath = path.get("value");
384
- if (path.node.computed) {
385
- checkOrIgnoreExpression(path.get("key"), search);
380
+ if (propPath.isObjectProperty()) {
381
+ const keyPath = propPath.get("key");
382
+ const valuePath = propPath.get("value");
383
+ if (propPath.node.computed ||
384
+ !(keyPath.isIdentifier() &&
385
+ valuePath.isIdentifier() &&
386
+ keyPath.node.name.startsWith("$") === valuePath.node.name.startsWith("$"))) {
387
+ if (propPath.node.computed) {
388
+ checkOrIgnoreExpression(propPath.get("key"), search);
389
+ }
390
+ checkOrIgnoreExpression(valuePath, search);
386
391
  }
387
- checkOrIgnoreExpression(valuePath, search);
388
392
  }
389
- else if (t.isObjectMethod(prop)) {
393
+ else if (propPath.isObjectMethod()) {
390
394
  checkFunction(propPath, search);
391
395
  }
392
396
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-vasille",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Convert Vasille Meta Language code to pure JavaScript",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",