mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 08:47:00 +00:00
refactor(reference): share graph index projections
This commit is contained in:
1 parent
a6d9e49ab4
commit
6ee87fbf2d
2 files changed
+10
-30
No files matched your search
@@ -255,7 +255,8 @@ const checkSortedUnique = (
|
||||
}
|
||||
};
|
||||
|
||||
const expectedLanguages = (
|
||||
/** Derive the canonical language index from inventoried source files. */
|
||||
export const historicalSourceLanguages = (
|
||||
entries: readonly z.infer<typeof sourceEntrySchema>[],
|
||||
): string[] =>
|
||||
[
|
||||
@@ -268,7 +269,8 @@ const expectedLanguages = (
|
||||
),
|
||||
].sort(compareUnicodeCodePoints);
|
||||
|
||||
const expectedManifests = (
|
||||
/** Derive the canonical manifest path index from inventoried source files. */
|
||||
export const historicalSourceManifests = (
|
||||
entries: readonly z.infer<typeof sourceEntrySchema>[],
|
||||
): string[] =>
|
||||
entries
|
||||
@@ -408,7 +410,7 @@ function checkGraphInvariants(
|
||||
|
||||
if (
|
||||
canonicalJson(graph.languages) !==
|
||||
canonicalJson(expectedLanguages(graph.entries))
|
||||
canonicalJson(historicalSourceLanguages(graph.entries))
|
||||
)
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
@@ -417,7 +419,7 @@ function checkGraphInvariants(
|
||||
});
|
||||
if (
|
||||
canonicalJson(graph.manifests) !==
|
||||
canonicalJson(expectedManifests(graph.entries))
|
||||
canonicalJson(historicalSourceManifests(graph.entries))
|
||||
)
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
|
||||
Reference in new issue
Block a user