Skip to content

Commit

Permalink
Fix type check
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Jul 30, 2020
1 parent 98c5a37 commit 4cef0ca
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface AsyncSearchResponse<T> {
response: SearchResponse<T>;
}

export function isAsyncSearchResponse(response: any): response is AsyncSearchResponse {
export function isAsyncSearchResponse<T>(response: any): response is AsyncSearchResponse<T> {
return response.hasOwnProperty('is_partial') && response.hasOwnProperty('is_running');
}

Expand Down Expand Up @@ -59,7 +59,7 @@ export const enhancedEsSearchStrategyProvider = (

if (
usage &&
(!isAsyncSearchResponse(response) || (!response.is_partial && !response.is_running))
(!isAsyncSearchResponse<any>(response) || (!response.is_partial && !response.is_running))
) {
usage.trackSuccess(response.rawResponse.took);
}
Expand Down

0 comments on commit 4cef0ca

Please sign in to comment.