mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
fix: something
This commit is contained in:
1 parent
84300389f9
commit
846c2a4962
2 files changed
+5
-7
No files matched your search
@@ -1,9 +1,7 @@
|
|||||||
import { superDecompress } from './superDecompress';
|
import { superDecompress } from './superDecompress';
|
||||||
|
|
||||||
export async function fetchCdonLz4<Type>(url: string) {
|
export async function fetchCdonLz4<Type>(url: string) {
|
||||||
return await fetch(url, {
|
return await fetch(url, { cache: 'no-cache' })
|
||||||
cache: 'no-cache',
|
.then((response) => response.arrayBuffer())
|
||||||
}).then(async (response) => {
|
.then((buffer) => superDecompress<Type>(new Uint8Array(buffer)));
|
||||||
return superDecompress(Buffer.from(await response.arrayBuffer())) as Type;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { decompress } from 'lz4js';
|
import { decompress } from 'lz4js';
|
||||||
import { CdonReadStream } from '../streams/cdon';
|
import { CdonReadStream } from '../streams/cdon';
|
||||||
|
|
||||||
export function superDecompress<Type>(buffer: Buffer) {
|
export function superDecompress<Type>(buffer: ArrayBuffer) {
|
||||||
const decompressed = decompress(buffer).buffer;
|
const decompressed = decompress(new Uint8Array(buffer)).buffer;
|
||||||
const read = new CdonReadStream(decompressed);
|
const read = new CdonReadStream(decompressed);
|
||||||
return read.cdon() as Type;
|
return read.cdon() as Type;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user