mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 02:15:44 +00:00
refactor: use canonical implementations and types directly
Remove forwarding wrappers and shadow aliases, migrate callers and verification scripts to their owners, and share one exhaustive semantic resource-bound projection.
This commit is contained in:
1 parent
3283a45d09
commit
765e809e36
119 files changed
+577
-629
No files matched your search
@@ -9,7 +9,8 @@ import type {
|
||||
ApplicationNode,
|
||||
} from "./javascriptApplicationGraphSchemas.js";
|
||||
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
|
||||
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
|
||||
import { uniqueSorted } from "../canonicalOrdering.js";
|
||||
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
||||
import type { ApplicationVersionComparisonItem } from "./javascriptApplicationVersionComparisonSchemas.js";
|
||||
|
||||
interface ChangeGraphInput {
|
||||
@@ -218,7 +219,7 @@ const sourceCoverageLimits = (input: ChangeGraphInput) =>
|
||||
(limit) => [`${limit.name}\0${limit.value}\0${limit.unit}`, limit],
|
||||
),
|
||||
).values(),
|
||||
].sort((left, right) => compareCodePoints(left.name, right.name));
|
||||
].sort((left, right) => compareUnicodeCodePoints(left.name, right.name));
|
||||
|
||||
const combineOmittedCounts = (left: number | null, right: number | null) =>
|
||||
left === null || right === null ? null : left + right;
|
||||
@@ -238,7 +239,7 @@ const mergeNodes = (nodes: readonly ApplicationNode[]): ApplicationNode[] => {
|
||||
.map((observation) => [observation.observation_id, observation]),
|
||||
).values(),
|
||||
].sort((left, right) =>
|
||||
compareCodePoints(left.observation_id, right.observation_id),
|
||||
compareUnicodeCodePoints(left.observation_id, right.observation_id),
|
||||
);
|
||||
return createJavaScriptApplicationNode({
|
||||
kind: first.kind,
|
||||
@@ -250,11 +251,11 @@ const mergeNodes = (nodes: readonly ApplicationNode[]): ApplicationNode[] => {
|
||||
});
|
||||
});
|
||||
return merged.sort((left, right) =>
|
||||
compareCodePoints(left.node_id, right.node_id),
|
||||
compareUnicodeCodePoints(left.node_id, right.node_id),
|
||||
);
|
||||
};
|
||||
|
||||
const uniqueEdges = (edges: readonly ApplicationEdge[]): ApplicationEdge[] =>
|
||||
[...new Map(edges.map((edge) => [edge.edge_id, edge])).values()].sort(
|
||||
(left, right) => compareCodePoints(left.edge_id, right.edge_id),
|
||||
(left, right) => compareUnicodeCodePoints(left.edge_id, right.edge_id),
|
||||
);
|
||||
Reference in new issue
Block a user