mirror of
https://github.com/catdevnull/transicion-desordenada-diablo
synced 2024-11-14 18:21:38 +00:00
frontend: decompressionstream polyfill
This commit is contained in:
parent
840496a153
commit
6c65aa2ead
4 changed files with 28 additions and 2 deletions
|
@ -11,9 +11,10 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"common": "workspace:",
|
||||||
"p-limit": "^5.0.0",
|
"p-limit": "^5.0.0",
|
||||||
"undici": "^5.28.0",
|
"undici": "^5.28.0",
|
||||||
"common": "workspace:"
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node20": "^20.1.2",
|
"@tsconfig/node20": "^20.1.2",
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
"vite": "^5.0.0"
|
"vite": "^5.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"compression-streams-polyfill": "^0.1.6",
|
||||||
"eva-icons": "^1.1.3",
|
"eva-icons": "^1.1.3",
|
||||||
"navaid": "^1.2.0",
|
"navaid": "^1.2.0",
|
||||||
"regexparam": "^3.0.0",
|
"regexparam": "^3.0.0",
|
||||||
|
|
|
@ -25,7 +25,15 @@ async function fetchGzipped(url: string): Promise<Response> {
|
||||||
res = await fetch(url.slice(0, url.length - ".gz".length));
|
res = await fetch(url.slice(0, url.length - ".gz".length));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
const ds = new DecompressionStream("gzip");
|
let DecStream;
|
||||||
|
if ("DecompressionStream" in window) DecStream = window.DecompressionStream;
|
||||||
|
else {
|
||||||
|
const { makeDecompressionStream } = await import(
|
||||||
|
"compression-streams-polyfill/ponyfill"
|
||||||
|
);
|
||||||
|
DecStream = makeDecompressionStream(TransformStream);
|
||||||
|
}
|
||||||
|
const ds = new DecStream("gzip");
|
||||||
const decompressedStream = res.body!.pipeThrough(ds);
|
const decompressedStream = res.body!.pipeThrough(ds);
|
||||||
const resD = new Response(decompressedStream);
|
const resD = new Response(decompressedStream);
|
||||||
return resD;
|
return resD;
|
||||||
|
|
|
@ -23,6 +23,9 @@ importers:
|
||||||
undici:
|
undici:
|
||||||
specifier: ^5.28.0
|
specifier: ^5.28.0
|
||||||
version: 5.28.2
|
version: 5.28.2
|
||||||
|
zod:
|
||||||
|
specifier: ^3.22.4
|
||||||
|
version: 3.22.4
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@tsconfig/node20':
|
'@tsconfig/node20':
|
||||||
specifier: ^20.1.2
|
specifier: ^20.1.2
|
||||||
|
@ -33,6 +36,9 @@ importers:
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
compression-streams-polyfill:
|
||||||
|
specifier: ^0.1.6
|
||||||
|
version: 0.1.6
|
||||||
eva-icons:
|
eva-icons:
|
||||||
specifier: ^1.1.3
|
specifier: ^1.1.3
|
||||||
version: 1.1.3
|
version: 1.1.3
|
||||||
|
@ -703,6 +709,12 @@ packages:
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/compression-streams-polyfill@0.1.6:
|
||||||
|
resolution: {integrity: sha512-vYXHeCzZPfKqz/ppInffY2HkevGbV6zm5wlSgtrW0+6neApbA5qZdG48KaDEhRmbIFhLgmVUlUc+szH9NrcaBA==}
|
||||||
|
dependencies:
|
||||||
|
fflate: 0.8.1
|
||||||
|
dev: false
|
||||||
|
|
||||||
/concat-map@0.0.1:
|
/concat-map@0.0.1:
|
||||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
@ -888,6 +900,10 @@ packages:
|
||||||
reusify: 1.0.4
|
reusify: 1.0.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/fflate@0.8.1:
|
||||||
|
resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/fill-range@7.0.1:
|
/fill-range@7.0.1:
|
||||||
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
|
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
Loading…
Reference in a new issue