Skip to content

Commit 040f141

Browse files
[AUTOMATED]: Prettier Code Styling
1 parent 9544284 commit 040f141

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/firestore/scripts/extract-api.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ function extractIdentifiersFromNodeAndChildren(
3333
}
3434

3535
function extractTypeDeclaration(fileName: string): string {
36-
const compilerOptions = { declaration: true,
37-
emitDeclarationOnly: true}
38-
let dtsSource : string;
39-
const host = ts.createCompilerHost( compilerOptions);
40-
host.writeFile = (fileName: string, contents: string) => dtsSource = contents;
36+
const compilerOptions = { declaration: true, emitDeclarationOnly: true };
37+
let dtsSource: string;
38+
const host = ts.createCompilerHost(compilerOptions);
39+
host.writeFile = (fileName: string, contents: string) =>
40+
(dtsSource = contents);
4141
const program = ts.createProgram([fileName], compilerOptions, host);
42-
program.emit()
42+
program.emit();
4343
return dtsSource!;
4444
}
4545

@@ -57,10 +57,14 @@ export function extractPublicIdentifiers(filePaths: string[]): Set<string> {
5757
contents,
5858
ts.ScriptTarget.ES2015
5959
);
60-
60+
6161
if (!sourceFile.isDeclarationFile) {
62-
const dtsSource = extractTypeDeclaration(filePath);
63-
sourceFile = ts.createSourceFile(filePath.replace(".ts", ".d.ts"), dtsSource, ts.ScriptTarget.ES2015);
62+
const dtsSource = extractTypeDeclaration(filePath);
63+
sourceFile = ts.createSourceFile(
64+
filePath.replace('.ts', '.d.ts'),
65+
dtsSource,
66+
ts.ScriptTarget.ES2015
67+
);
6468
}
6569

6670
const identifiers = new Set<string>();

0 commit comments

Comments
 (0)