vue-hook-optimizer 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -86886,24 +86886,26 @@ function noIndegreeFilter(graph) {
86886
86886
 
86887
86887
  // src/suggest/index.ts
86888
86888
  function gen(graph, usedNodes) {
86889
- const suggests = [];
86889
+ const suggestions = [];
86890
86890
  const splitedGraph = splitGraph(graph.edges);
86891
86891
  splitedGraph.forEach((g) => {
86892
86892
  const nodes = Array.from(g.keys());
86893
86893
  if (splitedGraph.length > 1) {
86894
- suggests.push(`Node${nodes.length > 1 ? "s" : ""} [${nodes.length > 10 ? nodes.slice(0, 10).map((node2) => node2.label).join(",") + "...(" + nodes.length + ")" : nodes.map((node2) => node2.label).join(",")}] ${nodes.length > 1 ? "are" : "is"} isolated${nodes.length > 2 ? ", perhaps you can refactor them to an isolated file." : "."}`);
86894
+ if (nodes.length > 2 && nodes.some((node2) => !usedNodes.has(node2.label))) {
86895
+ suggestions.push(`Nodes [${nodes.length > 10 ? nodes.slice(0, 10).map((node2) => node2.label).join(",") + "...(" + nodes.length + ")" : nodes.map((node2) => node2.label).join(",")}] are isolated, perhaps you can refactor them to an isolated file.`);
86896
+ }
86895
86897
  }
86896
86898
  if (nodes.every((node2) => !usedNodes.has(node2.label))) {
86897
- suggests.push(`Node${nodes.length > 1 ? "s" : ""} [${nodes.length > 10 ? nodes.slice(0, 10).map((node2) => node2.label).join(",") + "..." : nodes.map((node2) => node2.label).join(",")}] ${nodes.length > 1 ? "are" : "is"} not used, perhaps you can remove ${nodes.length > 1 ? "them" : "it"}.`);
86899
+ suggestions.push(`Node${nodes.length > 1 ? "s" : ""} [${nodes.length > 10 ? nodes.slice(0, 10).map((node2) => node2.label).join(",") + "..." : nodes.map((node2) => node2.label).join(",")}] ${nodes.length > 1 ? "are" : "is"} not used, perhaps you can remove ${nodes.length > 1 ? "them" : "it"}.`);
86898
86900
  }
86899
86901
  });
86900
86902
  const noIndegreeNodes = noIndegreeFilter(graph.edges);
86901
86903
  noIndegreeNodes.forEach((node2) => {
86902
86904
  if (!usedNodes.has(node2.label)) {
86903
- suggests.push(`Node [${node2.label}] is not used, perhaps you can remove it.`);
86905
+ suggestions.push(`Node [${node2.label}] is not used, perhaps you can remove it.`);
86904
86906
  }
86905
86907
  });
86906
- return suggests;
86908
+ return suggestions;
86907
86909
  }
86908
86910
 
86909
86911
  // src/vis.ts