Skip to content

Commit 035091c

Browse files
[AUTOMATED]: Prettier Code Styling
1 parent 7df1038 commit 035091c

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

packages/firestore/exp/test/deps/verify_dependencies.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ describe('Dependencies', () => {
2727
forEach(dependencies, (api, { dependencies }) => {
2828
it(api, () => {
2929
return extractDependencies(api, pkg.exp).then(extractedDependencies => {
30-
expect(extractedDependencies.classes).to.have.members(dependencies.classes, "for classes");
31-
expect(extractedDependencies.functions).to.have.members(dependencies.functions, "for functions");
32-
expect(extractedDependencies.variables).to.have.members(dependencies.variables, "for variables");
30+
expect(extractedDependencies.classes).to.have.members(
31+
dependencies.classes,
32+
'for classes'
33+
);
34+
expect(extractedDependencies.functions).to.have.members(
35+
dependencies.functions,
36+
'for functions'
37+
);
38+
expect(extractedDependencies.variables).to.have.members(
39+
dependencies.variables,
40+
'for variables'
41+
);
3342
});
3443
});
3544
});

scripts/exp/extract-deps.helpers.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import * as ts from 'typescript';
2424

2525
/** Contains a list of members by type. */
2626
export type MemberList = {
27-
classes: string[],
28-
functions: string[],
29-
variables: string[]
27+
classes: string[];
28+
functions: string[];
29+
variables: string[];
3030
};
3131
/** Contains the dependencies and the size of their code for a single export. */
3232
export type ExportData = { dependencies: MemberList; sizeInBytes: number };
@@ -75,7 +75,7 @@ export async function extractDependenciesAndSize(
7575
});
7676
await bundle.write({ file: output, format: 'es' });
7777

78-
const dependencies = extractDeclarations(output);;
78+
const dependencies = extractDeclarations(output);
7979

8080
// Extract size of minified build
8181
const afterContent = fs.readFileSync(output, 'utf-8');
@@ -94,7 +94,7 @@ export async function extractDependenciesAndSize(
9494
}
9595

9696
/**
97-
* Extracts all function, class and variable declarations using the TypeScript
97+
* Extracts all function, class and variable declarations using the TypeScript
9898
* compiler API.
9999
*/
100100
export function extractDeclarations(jsFile: string): MemberList {
@@ -104,7 +104,11 @@ export function extractDeclarations(jsFile: string): MemberList {
104104
throw new Error('Failed to parse file: ' + jsFile);
105105
}
106106

107-
const declarations: MemberList = { functions: [], classes: [], variables: []}
107+
const declarations: MemberList = {
108+
functions: [],
109+
classes: [],
110+
variables: []
111+
};
108112
ts.forEachChild(sourceFile, node => {
109113
if (ts.isFunctionDeclaration(node)) {
110114
declarations.functions.push(node.name!.text);
@@ -114,11 +118,11 @@ export function extractDeclarations(jsFile: string): MemberList {
114118
declarations.variables.push(node.name!.getText());
115119
}
116120
});
117-
121+
118122
// Sort to ensure stable output
119123
declarations.functions.sort();
120124
declarations.classes.sort();
121125
declarations.variables.sort();
122-
126+
123127
return declarations;
124128
}

scripts/exp/extract-deps.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import * as yargs from 'yargs';
2121
import {
2222
ExportData,
2323
extractDependenciesAndSize,
24-
extractDeclarations, MemberList
24+
extractDeclarations,
25+
MemberList
2526
} from './extract-deps.helpers';
2627

2728
// Small command line app that builds a JSON file with a list of the
@@ -47,7 +48,10 @@ const argv = yargs.options({
4748
}
4849
}).argv;
4950

50-
async function buildJson(publicApi: MemberList, jsFile: string): Promise<string> {
51+
async function buildJson(
52+
publicApi: MemberList,
53+
jsFile: string
54+
): Promise<string> {
5155
const result: { [key: string]: ExportData } = {};
5256
for (const exp of publicApi.classes) {
5357
result[exp] = await extractDependenciesAndSize(exp, jsFile);

0 commit comments

Comments
 (0)