Skip to content

Commit d80c643

Browse files
authored
avoid has collisions (#16)
1 parent f4276d3 commit d80c643

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/newHelperTypeName.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export const newHelperTypeName = (state: ParserState, type: ts.Type) => {
1313
let shortHash = fullHash.digest("base64").replace(/\W/g, '').substring(0, 10);
1414
if (state.helperTypeNames.has(shortHash) && state.helperTypeNames.get(shortHash) !== type) {
1515
shortHash = "HelperType" + state.helperTypeNames.size.toString();
16+
} else {
17+
state.helperTypeNames.set(shortHash, type);
1618
}
1719
return `Ts2Py_${shortHash}`;
1820
};

0 commit comments

Comments
 (0)