0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix(polyfills): Use object shape for Stackblitz polyfill list

This commit is contained in:
Princesseuh 2023-08-18 18:39:10 +02:00
parent db39206cbb
commit 632d1b6842
No known key found for this signature in database
GPG key ID: 105BBD6D57F2B0C0

View file

@ -24,7 +24,7 @@ const isStackblitz = process.env.SHELL === '/bin/jsh' && process.versions.webcon
export function apply() { export function apply() {
if (isStackblitz) { if (isStackblitz) {
const neededPolyfills = [ const neededPolyfills = {
ByteLengthQueuingStrategy, ByteLengthQueuingStrategy,
CountQueuingStrategy, CountQueuingStrategy,
ReadableByteStreamController, ReadableByteStreamController,
@ -43,7 +43,7 @@ export function apply() {
Request, Request,
Response, Response,
fetch, fetch,
]; };
for (let polyfillName of Object.keys(neededPolyfills)) { for (let polyfillName of Object.keys(neededPolyfills)) {
if (Object.hasOwnProperty.call(globalThis, polyfillName)) continue; if (Object.hasOwnProperty.call(globalThis, polyfillName)) continue;