MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / pickUniqueDuplicateKey

Function pickUniqueDuplicateKey

packages/cli/src/batch-transform.ts:1119–1128  ·  view source on GitHub ↗
(originalKey: string, usedKeys: Set<string>)

Source from the content-addressed store, hash-verified

1117}
1118
1119function pickUniqueDuplicateKey(originalKey: string, usedKeys: Set<string>): string {
1120 let candidate = `${originalKey}-copy`;
1121 let suffix = 2;
1122 while (usedKeys.has(candidate)) {
1123 candidate = `${originalKey}-copy-${suffix}`;
1124 suffix++;
1125 }
1126 usedKeys.add(candidate);
1127 return candidate;
1128}
1129
1130function deduplicateKey(
1131 jsxText: string,

Callers 1

deduplicateKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected