Skip to content

Commit d709ae4

Browse files
committed
cleanup
1 parent 0b901fa commit d709ae4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/cli/src/codegen/util.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export function disambiguateNames<T>({
99
}) {
1010
const collisionCounter = new Map();
1111
return values.map((value, index) => {
12-
let name = getName(value, index);
13-
name = handleReservedWord(name);
12+
const name = handleReservedWord(getName(value, index));
1413
const counter = collisionCounter.get(name);
1514
if (counter === undefined) {
1615
collisionCounter.set(name, 1);
@@ -21,7 +20,6 @@ export function disambiguateNames<T>({
2120
});
2221
}
2322

24-
// List of JavaScript reserved words that need to be handled
2523
const RESERVED_WORDS = new Set([
2624
'await',
2725
'break',
@@ -68,10 +66,9 @@ const RESERVED_WORDS = new Set([
6866
'void',
6967
'while',
7068
'with',
71-
'yield'
69+
'yield',
7270
]);
7371

74-
// Function to handle JavaScript reserved words by appending an underscore
7572
export function handleReservedWord(name: string): string {
7673
return RESERVED_WORDS.has(name) ? `${name}_` : name;
7774
}

0 commit comments

Comments
 (0)