@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/polyfill.js +4 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.20.29",
3
+ "version": "0.20.30",
4
4
  "description": "An experimental reimplementation of server.js focused on the DX",
5
5
  "homepage": "https://node-server.com/",
6
6
  "repository": "https://github.com/franciscop/server-next.git",
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
- self.Response = function Response(body, other = {}) {
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 (!self.process) {
20
- self.process = {};
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
  }