From 84a47354fbc9ada39683ff22019ea132b2cb21a0 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Wed, 1 Apr 2020 15:39:08 +0200 Subject: [PATCH] Update util.ts Co-Authored-By: Chris Sidi --- util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util.ts b/util.ts index 4f310b1..e17a95a 100644 --- a/util.ts +++ b/util.ts @@ -9,8 +9,8 @@ import {IHttpClientResponse} from './interfaces' * @param {string} charset * @return {Promise} */ -export async function decompressGzippedContent(buffer: Buffer, charset: string): Promise { - return new Promise(async (resolve, reject) => { +export function decompressGzippedContent(buffer: Buffer, charset: string): Promise { + return new Promise((resolve, reject) => { zlib.gunzip(buffer, function (error, buffer) { if (error) { reject(error); @@ -41,4 +41,4 @@ export function obtainContentCharset (response: IHttpClientResponse) : string { const matches: (RegExpMatchArray|null) = contentType.match(/charset=([^;,\r\n]+)/i); return (matches && matches[1]) ? matches[1] : 'utf-8'; -} \ No newline at end of file +}