-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremix-run-node-dist-globals.js
51 lines (48 loc) · 1.24 KB
/
remix-run-node-dist-globals.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @remix-run/node v2.9.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function installGlobals({
nativeFetch
} = {}) {
if (true) {
let {
File: UndiciFile,
fetch: undiciFetch,
FormData: UndiciFormData,
Headers: UndiciHeaders,
Request: UndiciRequest,
Response: UndiciResponse
} = require("undici");
global.File = UndiciFile;
global.Headers = UndiciHeaders;
global.Request = UndiciRequest;
global.Response = UndiciResponse;
global.fetch = undiciFetch;
global.FormData = UndiciFormData;
} else {
let {
File: RemixFile,
fetch: RemixFetch,
FormData: RemixFormData,
Headers: RemixHeaders,
Request: RemixRequest,
Response: RemixResponse
} = require("@remix-run/web-fetch");
global.File = RemixFile;
global.Headers = RemixHeaders;
global.Request = RemixRequest;
global.Response = RemixResponse;
global.fetch = RemixFetch;
global.FormData = RemixFormData;
}
}
exports.installGlobals = installGlobals;