vue-hook-optimizer 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -86311,9 +86311,10 @@ function analyze2(content) {
86311
86311
  const name = path2.node.id?.name;
86312
86312
  if (name && graph.nodes.has(name)) {
86313
86313
  path2.traverse({
86314
- Identifier(path3) {
86315
- if (graph.nodes.has(path3.node.name) && path3.node.name !== name) {
86316
- graph.edges.get(name)?.add(path3.node.name);
86314
+ Identifier(path1) {
86315
+ const binding2 = path1.scope.getBinding(path1.node.name);
86316
+ if (graph.nodes.has(path1.node.name) && path1.node.name !== name && binding2?.scope.block.type === "Program") {
86317
+ graph.edges.get(name)?.add(path1.node.name);
86317
86318
  }
86318
86319
  }
86319
86320
  });
@@ -86329,9 +86330,10 @@ function analyze2(content) {
86329
86330
  const name = path2.node.id?.name;
86330
86331
  if (name && graph.nodes.has(name)) {
86331
86332
  path2.traverse({
86332
- Identifier(path3) {
86333
- if (graph.nodes.has(path3.node.name) && path3.node.name !== name) {
86334
- graph.edges.get(name)?.add(path3.node.name);
86333
+ Identifier(path1) {
86334
+ const binding2 = path1.scope.getBinding(path1.node.name);
86335
+ if (graph.nodes.has(path1.node.name) && path1.node.name !== name && binding2?.scope.block.type === "Program") {
86336
+ graph.edges.get(name)?.add(path1.node.name);
86335
86337
  }
86336
86338
  }
86337
86339
  });
@@ -86579,7 +86581,6 @@ function analyze3(content) {
86579
86581
  process2(path2.node.declaration, path2);
86580
86582
  } else if (path2.node.declaration.type === "CallExpression" && path2.node.declaration.callee.type === "Identifier" && path2.node.declaration.callee.name === "defineComponent" && path2.node.declaration.arguments[0].type === "ObjectExpression") {
86581
86583
  process2(path2.node.declaration.arguments[0], path2);
86582
- console.log(graph);
86583
86584
  }
86584
86585
  }
86585
86586
  });