0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -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;