Skip to content

Commit

Permalink
fixing js generator
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalmishraa committed Sep 5, 2024
1 parent b64bc81 commit 5bf8eea
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export default function generateFullJs({
.map((field) => {
if (field.type.startsWith("list<")) {
return `const size_${field.name} = parseInt(input.shift());\nconst ${field.name} = input.splice(0, size_${field.name}).map(Number);`;
} else if (field.type === "string") {
return `const ${field.name} = input.shift();`;
} else {
return `const ${field.name} = parseInt(input.shift());`;
}
Expand Down

0 comments on commit 5bf8eea

Please sign in to comment.