Skip to content

Commit

Permalink
remove string from id
Browse files Browse the repository at this point in the history
  • Loading branch information
leowrites committed Oct 10, 2024
1 parent da01c92 commit 838ffa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions memory-viz/src/automate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,7 @@ function compareByHeight(a: DrawnEntity, b: DrawnEntity): number {
* @returns {number} negative if 'a.id' is larger, 0 if a.id == b.id, and positive if 'b.id' is larger.
*/
function compareByID(a: DrawnEntity, b: DrawnEntity): number {
if (typeof a.id === "number" && typeof b.id === "number") {
return a.id - b.id;
}
if (typeof a.id === "string" && typeof b.id === "string") {
return a.id.localeCompare(b.id);
}
return a.id - b.id;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion memory-viz/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface DrawnEntity {
type?: string;
x?: number;
y?: number;
id?: number | string | null;
id?: number | null;
value?: any;
show_indexes?: boolean;
style?: Styles;
Expand Down

0 comments on commit 838ffa0

Please sign in to comment.