mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
simplify decompression and decoding
This commit is contained in:
parent
203faa4257
commit
41d8dbad5d
@ -631,9 +631,7 @@ cqi.api.APIClient = class APIClient {
|
|||||||
const fn_name = 'ext_corpus_static_data';
|
const fn_name = 'ext_corpus_static_data';
|
||||||
const fn_args = {corpus: corpus};
|
const fn_args = {corpus: corpus};
|
||||||
let compressedEncodedData = await this.#request(fn_name, fn_args);
|
let compressedEncodedData = await this.#request(fn_name, fn_args);
|
||||||
let encodedData = pako.inflate(compressedEncodedData);
|
let data = pako.inflate(compressedEncodedData, {to: 'string'});
|
||||||
let textDecoder = new TextDecoder();
|
|
||||||
let data = textDecoder.decode(encodedData);
|
|
||||||
return JSON.parse(data);
|
return JSON.parse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user