mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +00:00
fix(workflows): retain container presence in export shape comparisons (#523)
Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
1 parent
bcfb4072f2
commit
385445804a
2 files changed
+101
-2
No files matched your search
@@ -251,8 +251,8 @@ const diffPair = (
|
||||
const rightFields = new Map(right.fields.map((field) => [field.path, field]));
|
||||
const paths = uniqueSorted([...leftFields.keys(), ...rightFields.keys()]);
|
||||
return paths.flatMap((path) => {
|
||||
const leftField = leftFields.get(path);
|
||||
const rightField = rightFields.get(path);
|
||||
const leftField = fieldAtPath(left, leftFields, path);
|
||||
const rightField = fieldAtPath(right, rightFields, path);
|
||||
const status = fieldChangeStatus({
|
||||
leftShape: left,
|
||||
rightShape: right,
|
||||
@@ -282,6 +282,24 @@ const diffPair = (
|
||||
});
|
||||
};
|
||||
|
||||
const fieldAtPath = (
|
||||
shape: Shape,
|
||||
fields: ReadonlyMap<string, Field>,
|
||||
path: string,
|
||||
): Field | undefined => {
|
||||
const field = fields.get(path);
|
||||
if (field !== undefined) return field;
|
||||
if (!shape.property_coverage.some((coverage) => coverage.path === path))
|
||||
return undefined;
|
||||
return {
|
||||
path,
|
||||
state: "unknown",
|
||||
value: null,
|
||||
reason:
|
||||
"A static container is retained at this path, but no primitive field value is projected.",
|
||||
};
|
||||
};
|
||||
|
||||
interface FieldChangeInput {
|
||||
readonly leftShape: Shape;
|
||||
readonly rightShape: Shape;
|
||||
|
||||
Reference in new issue
Block a user