@@ -32,7 +32,7 @@ import * as fs from 'fs';
32
32
* @param inputLocation The file path to the .d.ts produced by API explorer.
33
33
* @param outputLocation The output location for the pruned .d.ts file.
34
34
*/
35
- function main ( inputLocation : string , outputLocation : string ) {
35
+ function main ( inputLocation : string , outputLocation : string ) : void {
36
36
const compilerOptions = { } ;
37
37
const host = ts . createCompilerHost ( compilerOptions ) ;
38
38
const program = ts . createProgram ( [ inputLocation ] , compilerOptions , host ) ;
@@ -68,7 +68,9 @@ function isExported(modifiers?: ts.ModifiersArray): boolean {
68
68
* Returns either the modified constructor or the existing constructor if no
69
69
* modification was needed.
70
70
*/
71
- function maybeHideConstructor ( node : ts . ConstructorDeclaration ) {
71
+ function maybeHideConstructor (
72
+ node : ts . ConstructorDeclaration
73
+ ) : ts . ConstructorDeclaration {
72
74
const hideConstructorTag = ts
73
75
. getJSDocTags ( node )
74
76
?. find ( t => t . tagName . escapedText === 'hideconstructor' ) ;
@@ -132,7 +134,7 @@ function prunePrivateImports<
132
134
sourceFile ,
133
135
type . expression
134
136
) ;
135
- if ( publicName && publicName != currentName ) {
137
+ if ( publicName && publicName !== currentName ) {
136
138
// If there is a public type that we can refer to, update the import
137
139
// statement to refer to the public type.
138
140
exportedTypes . push (
@@ -225,7 +227,7 @@ function extractPublicName(
225
227
// private type.
226
228
for ( const symbol of allPublicSymbols ) {
227
229
// Short circuit if the local types is already part of the public types.
228
- if ( symbol . name == localSymbolName ) {
230
+ if ( symbol . name === localSymbolName ) {
229
231
return symbol . name ;
230
232
}
231
233
@@ -238,7 +240,7 @@ function extractPublicName(
238
240
for ( const type of heritageClause . types || [ ] ) {
239
241
if ( ts . isIdentifier ( type . expression ) ) {
240
242
const subclassName = type . expression . escapedText ;
241
- if ( subclassName == localSymbolName ) {
243
+ if ( subclassName === localSymbolName ) {
242
244
publicSymbolsForLocalType . push ( symbol . name ) ;
243
245
}
244
246
}
@@ -256,7 +258,7 @@ const dropPrivateApiTransformer = (
256
258
context : ts . TransformationContext
257
259
) => {
258
260
return ( sourceFile : ts . SourceFile ) => {
259
- function visit ( node : ts . Node ) : any {
261
+ function visit ( node : ts . Node ) : ts . Node {
260
262
if (
261
263
ts . isInterfaceDeclaration ( node ) ||
262
264
ts . isClassDeclaration ( node ) ||
0 commit comments