feat: модуль upload — вынос слоёв 1 и 2 (выбор файлов + закачка через ВМ), файл-на-функцию, тесты
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// inflateRaw — распаковка deflate-raw (метод 8) через нативный DecompressionStream.
|
||||
|
||||
export async function inflateRaw(bytes) {
|
||||
const ds = new DecompressionStream('deflate-raw');
|
||||
const stream = new Blob([bytes]).stream().pipeThrough(ds);
|
||||
const ab = await new Response(stream).arrayBuffer();
|
||||
return new Uint8Array(ab);
|
||||
}
|
||||
Reference in New Issue
Block a user