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() {
if (isStackblitz) {
const neededPolyfills = [
const neededPolyfills = {
ByteLengthQueuingStrategy,
CountQueuingStrategy,
ReadableByteStreamController,
@ -43,7 +43,7 @@ export function apply() {
Request,
Response,
fetch,
];
};
for (let polyfillName of Object.keys(neededPolyfills)) {
if (Object.hasOwnProperty.call(globalThis, polyfillName)) continue;