simplify decompression and decoding

This commit is contained in:
Patrick Jentsch 2023-07-12 11:25:58 +02:00
parent 203faa4257
commit 41d8dbad5d

View File

@ -631,9 +631,7 @@ cqi.api.APIClient = class APIClient {
const fn_name = 'ext_corpus_static_data';
const fn_args = {corpus: corpus};
let compressedEncodedData = await this.#request(fn_name, fn_args);
let encodedData = pako.inflate(compressedEncodedData);
let textDecoder = new TextDecoder();
let data = textDecoder.decode(encodedData);
let data = pako.inflate(compressedEncodedData, {to: 'string'});
return JSON.parse(data);
}