Skip to content

Commit 4701cde

Browse files
Better comment
1 parent ea361a4 commit 4701cde

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/firestore/scripts/extract-api.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ function extractIdentifiersFromNodeAndChildren(
3232
);
3333
}
3434

35+
/** Generates the "d.ts" content for `fileName`. */
3536
function extractTypeDeclaration(fileName: string): string {
37+
let result: string;
3638
const compilerOptions = { declaration: true, emitDeclarationOnly: true };
37-
let dtsSource: string;
3839
const host = ts.createCompilerHost(compilerOptions);
39-
host.writeFile = (fileName: string, contents: string) =>
40-
(dtsSource = contents);
40+
host.writeFile = (_: string, contents: string) => (result = contents);
4141
const program = ts.createProgram([fileName], compilerOptions, host);
4242
program.emit();
43-
return dtsSource!;
43+
return result!;
4444
}
4545

4646
/**

0 commit comments

Comments
 (0)