Skip to content

Commit

Permalink
Merge pull request #163 from hemedani/main
Browse files Browse the repository at this point in the history
🚨 fixed number enum in declaration
  • Loading branch information
hemedani committed May 25, 2024
2 parents db10439 + 30d3146 commit b181924
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/types/generateTypesFromStruct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ export const generateTypesFromStruct = (
let currentCount = 0;
for (const key in schemaStruct.schema as Object) {
currentCount++;
const keyValue = isNaN(key as any) ? `"${key}"` : Number(key);
if (currentCount === propertyCount) {
returnStr = returnStr + `"${key}" `;
returnStr = returnStr + `${keyValue} `;
} else {
returnStr = returnStr + `"${key}" | `;
returnStr = returnStr + `${keyValue} | `;
}
}
returnStr = returnStr +
Expand Down

0 comments on commit b181924

Please sign in to comment.