vue-hook-optimizer 0.0.14 → 0.0.15
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.
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
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
|
-
|
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
|
-
|
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
|
-
|
86893
|
+
suggestions.push(`Node [${node2.label}] is not used, perhaps you can remove it.`);
|
86892
86894
|
}
|
86893
86895
|
});
|
86894
|
-
return
|
86896
|
+
return suggestions;
|
86895
86897
|
}
|
86896
86898
|
|
86897
86899
|
// src/vis.ts
|