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.mjs CHANGED
@@ -86874,24 +86874,26 @@ function noIndegreeFilter(graph) {
86874
86874
 
86875
86875
  // src/suggest/index.ts
86876
86876
  function gen(graph, usedNodes) {
86877
- const suggests = [];
86877
+ const suggestions = [];
86878
86878
  const splitedGraph = splitGraph(graph.edges);
86879
86879
  splitedGraph.forEach((g) => {
86880
86880
  const nodes = Array.from(g.keys());
86881
86881
  if (splitedGraph.length > 1) {
86882
- 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." : "."}`);
86882
+ if (nodes.length > 2 && nodes.some((node2) => !usedNodes.has(node2.label))) {
86883
+ 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.`);
86884
+ }
86883
86885
  }
86884
86886
  if (nodes.every((node2) => !usedNodes.has(node2.label))) {
86885
- 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"}.`);
86887
+ 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"}.`);
86886
86888
  }
86887
86889
  });
86888
86890
  const noIndegreeNodes = noIndegreeFilter(graph.edges);
86889
86891
  noIndegreeNodes.forEach((node2) => {
86890
86892
  if (!usedNodes.has(node2.label)) {
86891
- suggests.push(`Node [${node2.label}] is not used, perhaps you can remove it.`);
86893
+ suggestions.push(`Node [${node2.label}] is not used, perhaps you can remove it.`);
86892
86894
  }
86893
86895
  });
86894
- return suggests;
86896
+ return suggestions;
86895
86897
  }
86896
86898
 
86897
86899
  // src/vis.ts