Fix incorrect types in rest-client extractJson (#68)

Signed-off-by: Nikolay Marchuk <nikolay.marchuk@hardcoreeng.com>
This commit is contained in:
Nikolay Marchuk
2025-06-16 09:52:00 +04:00
committed by GitHub
parent d7bbbc7723
commit 7e9657a78b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ class RestClientImpl implements RestClient {
if (!response.ok) {
throw new Error(response.statusText)
}
return await extractJson<MessagesGroup[]>(response)
return await extractJson<Message[]>(response)
},
{ retries }
)
+1 -1
View File
@@ -27,7 +27,7 @@ function reviver (key: string, value: any): Date {
return value
}
export async function extractJson<T> (response: Response): Promise<any> {
export async function extractJson<T> (response: Response): Promise<T> {
const encoding = response.headers.get('content-encoding')
if (encoding === 'snappy') {
const buffer = await response.arrayBuffer()