We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea361a4 commit 4701cdeCopy full SHA for 4701cde
packages/firestore/scripts/extract-api.ts
@@ -32,15 +32,15 @@ function extractIdentifiersFromNodeAndChildren(
32
);
33
}
34
35
+/** Generates the "d.ts" content for `fileName`. */
36
function extractTypeDeclaration(fileName: string): string {
37
+ let result: string;
38
const compilerOptions = { declaration: true, emitDeclarationOnly: true };
- let dtsSource: string;
39
const host = ts.createCompilerHost(compilerOptions);
- host.writeFile = (fileName: string, contents: string) =>
40
- (dtsSource = contents);
+ host.writeFile = (_: string, contents: string) => (result = contents);
41
const program = ts.createProgram([fileName], compilerOptions, host);
42
program.emit();
43
- return dtsSource!;
+ return result!;
44
45
46
/**
0 commit comments