core/selectors/code.selector.ts
core/selectors/code.selector.ts is a file in GovLab Patterns. 7 lines of code and 2 definitions.
import type { CallEdge, CodeGraph } from "#types/code.types";
export const sortedEdges = function sortedEdges(graph: CodeGraph): CallEdge[] {
return [...graph.edges].sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)));
};
export const unresolvedNames = function unresolvedNames(graph: CodeGraph): string[] {
return [...new Set(graph.external.map((call) => call.name))].sort((a, b) => a.localeCompare(b));
};