@server/next 0.20.29 → 0.20.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/polyfill.js +4 -18
package/package.json
CHANGED
package/src/polyfill.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
const self =
|
|
2
|
-
typeof globalThis !== "undefined"
|
|
3
|
-
? globalThis
|
|
4
|
-
: typeof global !== "undefined"
|
|
5
|
-
? global
|
|
6
|
-
: typeof window !== "undefined"
|
|
7
|
-
? window
|
|
8
|
-
: null;
|
|
9
|
-
|
|
10
1
|
// out = new Response(out, { headers: { "content-type": type } });
|
|
11
2
|
if (typeof Response === "undefined") {
|
|
12
|
-
|
|
3
|
+
global.Response = function Response(body, other = {}) {
|
|
13
4
|
return { body, ...other };
|
|
14
5
|
};
|
|
15
6
|
}
|
|
16
7
|
|
|
17
8
|
// Polyfill Netlify's environment variables
|
|
18
|
-
if (typeof Netlify !== "undefined") {
|
|
19
|
-
if (!
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
if (!self.process.env) {
|
|
23
|
-
self.process.env = {};
|
|
24
|
-
}
|
|
25
|
-
Object.assign(self.process.env, Netlify.env.toObject());
|
|
9
|
+
if (typeof Netlify !== "undefined" && typeof import.meta !== "undefined") {
|
|
10
|
+
if (!import.meta.env) import.meta.env = {};
|
|
11
|
+
Object.assign(import.meta.env, Netlify.env.toObject());
|
|
26
12
|
}
|