@@ -118,9 +118,9 @@ function findSystemGitWin32(base: string): Promise<IGit> {
118118}
119119
120120function findGitWin32 ( ) : Promise < IGit > {
121- return findSystemGitWin32 ( process . env [ 'ProgramW6432' ] )
122- . then ( void 0 , ( ) => findSystemGitWin32 ( process . env [ 'ProgramFiles(x86)' ] ) )
123- . then ( void 0 , ( ) => findSystemGitWin32 ( process . env [ 'ProgramFiles' ] ) )
121+ return findSystemGitWin32 ( process . env [ 'ProgramW6432' ] as string )
122+ . then ( void 0 , ( ) => findSystemGitWin32 ( process . env [ 'ProgramFiles(x86)' ] as string ) )
123+ . then ( void 0 , ( ) => findSystemGitWin32 ( process . env [ 'ProgramFiles' ] as string ) )
124124 . then ( void 0 , ( ) => findSpecificGit ( 'git' ) ) ;
125125}
126126
@@ -173,12 +173,12 @@ async function exec(child: cp.ChildProcess, options: SpawnOptions = {}): Promise
173173
174174 const disposables : IDisposable [ ] = [ ] ;
175175
176- const once = ( ee : NodeJS . EventEmitter , name : string , fn : Function ) => {
176+ const once = ( ee : NodeJS . EventEmitter , name : string , fn : ( ... args : any [ ] ) => void ) => {
177177 ee . once ( name , fn ) ;
178178 disposables . push ( toDisposable ( ( ) => ee . removeListener ( name , fn ) ) ) ;
179179 } ;
180180
181- const on = ( ee : NodeJS . EventEmitter , name : string , fn : Function ) => {
181+ const on = ( ee : NodeJS . EventEmitter , name : string , fn : ( ... args : any [ ] ) => void ) => {
182182 ee . on ( name , fn ) ;
183183 disposables . push ( toDisposable ( ( ) => ee . removeListener ( name , fn ) ) ) ;
184184 } ;
@@ -193,12 +193,12 @@ async function exec(child: cp.ChildProcess, options: SpawnOptions = {}): Promise
193193 } ) ,
194194 new Promise < string > ( c => {
195195 const buffers : Buffer [ ] = [ ] ;
196- on ( child . stdout , 'data' , b => buffers . push ( b ) ) ;
196+ on ( child . stdout , 'data' , ( b : Buffer ) => buffers . push ( b ) ) ;
197197 once ( child . stdout , 'close' , ( ) => c ( iconv . decode ( Buffer . concat ( buffers ) , encoding ) ) ) ;
198198 } ) ,
199199 new Promise < string > ( c => {
200200 const buffers : Buffer [ ] = [ ] ;
201- on ( child . stderr , 'data' , b => buffers . push ( b ) ) ;
201+ on ( child . stderr , 'data' , ( b : Buffer ) => buffers . push ( b ) ) ;
202202 once ( child . stderr , 'close' , ( ) => c ( Buffer . concat ( buffers ) . toString ( 'utf8' ) ) ) ;
203203 } )
204204 ] ) ;
@@ -891,7 +891,7 @@ export class Repository {
891891 const env = { GIT_OPTIONAL_LOCKS : '0' } ;
892892 const child = this . stream ( [ 'status' , '-z' , '-u' ] , { env } ) ;
893893
894- const onExit = exitCode => {
894+ const onExit = ( exitCode : number ) => {
895895 if ( exitCode !== 0 ) {
896896 const stderr = stderrData . join ( '' ) ;
897897 return e ( new GitError ( {
@@ -953,7 +953,7 @@ export class Repository {
953953 async getRefs ( ) : Promise < Ref [ ] > {
954954 const result = await this . run ( [ 'for-each-ref' , '--format' , '%(refname) %(objectname)' ] ) ;
955955
956- const fn = ( line ) : Ref | null => {
956+ const fn = ( line : string ) : Ref | null => {
957957 let match : RegExpExecArray | null ;
958958
959959 if ( match = / ^ r e f s \/ h e a d s \/ ( [ ^ ] + ) ( [ 0 - 9 a - f ] { 40 } ) $ / . exec ( line ) ) {
@@ -978,7 +978,7 @@ export class Repository {
978978 const regex = / ^ s t a s h @ { ( \d + ) } : ( .+ ) $ / ;
979979 const rawStashes = result . stdout . trim ( ) . split ( '\n' )
980980 . filter ( b => ! ! b )
981- . map ( line => regex . exec ( line ) )
981+ . map ( line => regex . exec ( line ) as RegExpExecArray )
982982 . filter ( g => ! ! g )
983983 . map ( ( [ , index , description ] : RegExpExecArray ) => ( { index : parseInt ( index ) , description } ) ) ;
984984
@@ -990,7 +990,7 @@ export class Repository {
990990 const regex = / ^ ( [ ^ \s ] + ) \s + ( [ ^ \s ] + ) \s / ;
991991 const rawRemotes = result . stdout . trim ( ) . split ( '\n' )
992992 . filter ( b => ! ! b )
993- . map ( line => regex . exec ( line ) )
993+ . map ( line => regex . exec ( line ) as RegExpExecArray )
994994 . filter ( g => ! ! g )
995995 . map ( ( groups : RegExpExecArray ) => ( { name : groups [ 1 ] , url : groups [ 2 ] } ) ) ;
996996
0 commit comments