stack: change stack types from Map<A,B> to {A: B}

Summary:
The stack types are meant to be JSON (de-)serialized. `Map` does not play well
with JSON so let's change them to classic object `{A: B}` format.

Reviewed By: evangrayk

Differential Revision: D44845633

fbshipit-source-id: 9f8eb539defe084f325ce9d1de2fa7159914467f
This commit is contained in:
Jun Wu 2023-04-21 15:51:13 -07:00 committed by Facebook GitHub Bot
parent 25e8cf5efc
commit 8ca2e93b9f

View File

@ -31,8 +31,8 @@ export type ExportCommit = {
immutable: boolean;
parents?: Hash[];
/** Files changed by this commit. `null` means the file is deleted. */
files?: Map<RepoPath, ExportFile | null>;
relevantFiles?: Map<RepoPath, ExportFile | null>;
files?: {[path: RepoPath]: ExportFile | null};
relevantFiles?: {[path: RepoPath]: ExportFile | null};
};
export type ExportFile = {
@ -62,7 +62,7 @@ export type ImportCommit = {
predecessors?: (Hash | Mark)[];
/** Why predecessors are obsoleted? For example, 'amend', 'split', 'histedit'. */
operation?: string;
files: Map<RepoPath, ExportFile | null>;
files: {[path: RepoPath]: ExportFile | null};
};
/** Update the "current commit" without changing the working copy. */