@@ -105,8 +105,6 @@ async function logAndExec(cmd, options) {
105105function getPatchedContents ( srcFile , contents ) {
106106 contents = updateCopyright ( srcFile , contents ) ;
107107 contents = fixNodeJsEventEmitterType ( srcFile , contents ) ;
108- contents = fixStatsImportInternalLibrary ( srcFile , contents ) ;
109- contents = fixSemicolonError ( srcFile , contents ) ;
110108 return contents ;
111109}
112110
@@ -147,44 +145,4 @@ function fixNodeJsEventEmitterType(srcFile, contents) {
147145 `import {NodeJsEventEmitter} from '${ relativeSrcDir } node/types';` ) ;
148146 contents = lines . join ( '\n' ) ;
149147 return contents ;
150- }
151-
152- /**
153- * Replaces the `cls` import and usage and adds a new type to use instead of that import.
154- * This function might be provisional until @opencensus/core updates with this change.
155- *
156- */
157- function fixStatsImportInternalLibrary ( srcFile , contents ) {
158- if ( contents . indexOf ( 'import * as cls from \'../internal/cls\';' ) === - 1 ) {
159- return contents ;
160- }
161-
162- console . log ( ` Using Fix stats import internal library for: ${ srcFile } ` ) ;
163-
164- const contentToAdd = [
165- "/** Default type for functions */" ,
166- "// tslint:disable:no-any" ,
167- "export type Func<T> = (...args: any[]) => T;" ,
168- "\n" ,
169- "/** Main interface for stats. */"
170- ] . join ( '\n' ) ;
171-
172- contents = contents . replace ( "import * as cls from '../internal/cls';\n" , "" ) ;
173- contents = contents . replace ( '/** Main interface for stats. */' , contentToAdd ) ;
174- contents = contents . replace ( 'cls.Func' , 'Func' ) ;
175- return contents ;
176- }
177-
178- /**
179- * Adds a Semicolon in a specific location in order to perform `npm run fix` automatically without errors.
180- * This function might be provisional until @opencensus/core updates with this change.
181- */
182- function fixSemicolonError ( srcFile , contents ) {
183- if ( contents . indexOf ( '[pluginName: string]: string\n' ) === - 1 ) {
184- return contents ;
185- }
186-
187- console . log ( ` Using fix semicolon error for: ${ srcFile } ` ) ;
188-
189- return contents . replace ( '[pluginName: string]: string\n' , '[pluginName: string]: string;\n' ) ;
190- }
148+ }
0 commit comments