Skip to content

Commit

Permalink
refactor: move let variables to iife
Browse files Browse the repository at this point in the history
  • Loading branch information
KoichiKiyokawa committed Mar 13, 2023
1 parent d5f9382 commit 44cad39
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ export async function extractQueryType({
return `import('${importPath}').Query`;
}

let openBraceCount = 0;
let closeBraceCount = 0;

const startIndex = source.indexOf("export type Query");
const endIndex = (() => {
let openBraceCount = 0;
let closeBraceCount = 0;
for (let i = startIndex; i < source.length; i++) {
if (source[i] === "{") openBraceCount++;
if (source[i] === "}") closeBraceCount++;
Expand Down

0 comments on commit 44cad39

Please sign in to comment.