mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 06:46:10 +00:00
fix(evidence): preserve view identity and cancellation outcomes
This commit is contained in:
1 parent
6de60993b8
commit
5f9f13d77b
5 files changed
+354
-38
No files matched your search
@@ -40,17 +40,20 @@ const layoutUnknowns = (layout: BinaryLayout): readonly string[] => {
|
||||
return unknowns;
|
||||
};
|
||||
|
||||
const displayName = (name: LayoutName): string => name.display;
|
||||
|
||||
const namedMatches = <Row extends { readonly name: LayoutName }>(
|
||||
rows: readonly Row[],
|
||||
name: string,
|
||||
): readonly { readonly index: number; readonly row: Row }[] =>
|
||||
rows.flatMap((row, index) =>
|
||||
row.name.unknown_reason === null && displayName(row.name) === name
|
||||
): readonly { readonly index: number; readonly row: Row }[] => {
|
||||
const bytes = Buffer.from(name, "utf8");
|
||||
// Display text may replace malformed source bytes or use provider formatting.
|
||||
if (bytes.toString("utf8") !== name) return [];
|
||||
const encoded = bytes.toString("base64");
|
||||
return rows.flatMap((row, index) =>
|
||||
row.name.unknown_reason === null && row.name.bytes_base64 === encoded
|
||||
? [{ index, row }]
|
||||
: [],
|
||||
);
|
||||
};
|
||||
|
||||
const selectNamed = <Row extends { readonly name: LayoutName }>(
|
||||
collection: "sections" | "symbols",
|
||||
|
||||
Reference in new issue
Block a user