Skip to content

Commit

Permalink
fix: merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Jan 10, 2025
1 parent 2f1b3da commit 2b53581
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tools/list-duplicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { visitType } from "../src/typegate/src/typegraph/visitor.ts";
import { projectDir } from "./utils.ts";
import { TypeNode } from "../src/typegate/src/typegraph/type_node.ts";

<<<<<<< Updated upstream
=======
export function listDuplicatesEnhanced(tg: TypeGraphDS, _rootIdx = 0) {
// to <- from
const reducedSetMap = new Map<number, number[]>();
Expand Down Expand Up @@ -49,8 +47,7 @@ export function listDuplicatesEnhanced(tg: TypeGraphDS, _rootIdx = 0) {
let idx = -1;
/* visitType(tg, rootIdx, ({ type, idx }) => {
}, { allowCircular: false }); */
for (const type of tg.types) {
idx += 1;
for (const type of tg.types) { idx += 1;
if (reducedSet.has(idx)) {
continue;
}
Expand Down Expand Up @@ -261,22 +258,17 @@ export function listDuplicatesEnhanced(tg: TypeGraphDS, _rootIdx = 0) {
optionalTypeCount,
});
}
>>>>>>> Stashed changes
export function listDuplicates(tg: TypeGraphDS, rootIdx = 0) {
const bins = new Map<string, readonly [number, TypeNode][]>();
const duplicateNameBins = new Map<string, readonly [number, TypeNode][]>();
visitType(tg, rootIdx, ({ type, idx }) => {
const { title, description: _description, ...structure } = type;
const hash = objectHash(structure as any);
bins.set(hash, [...bins.get(hash) ?? [], [idx, type] as const]);
<<<<<<< Updated upstream
duplicateNameBins.set(title, [...duplicateNameBins.get(name) ?? [], [idx, type] as const]);
=======
duplicateNameBins.set(title, [
...duplicateNameBins.get(title) ?? [],
[idx, type] as const,
]);
>>>>>>> Stashed changes
return true;
}, { allowCircular: false });
let dupesBinsFound = 0;
Expand Down

0 comments on commit 2b53581

Please sign in to comment.