1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var _a;
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 | exports.hasAbortController = exports.isNodeJS = exports.hasTextDecoder = exports.hasTextEncoder = exports.hasWindowFetch = void 0;
|
20 |
|
21 | const features = {
|
22 | windowFetch: typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fetch) &&
|
23 | typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function',
|
24 |
|
25 | textEncoder: typeof TextEncoder !== 'undefined',
|
26 |
|
27 | textDecoder: typeof TextDecoder !== 'undefined',
|
28 | nodeJS: typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node),
|
29 | abortController: typeof AbortController !== 'undefined',
|
30 | };
|
31 | function hasWindowFetch() {
|
32 | return features.windowFetch;
|
33 | }
|
34 | exports.hasWindowFetch = hasWindowFetch;
|
35 | function hasTextEncoder() {
|
36 | return features.textEncoder;
|
37 | }
|
38 | exports.hasTextEncoder = hasTextEncoder;
|
39 | function hasTextDecoder() {
|
40 | return features.textDecoder;
|
41 | }
|
42 | exports.hasTextDecoder = hasTextDecoder;
|
43 | function isNodeJS() {
|
44 | return features.nodeJS;
|
45 | }
|
46 | exports.isNodeJS = isNodeJS;
|
47 | function hasAbortController() {
|
48 | return features.abortController;
|
49 | }
|
50 | exports.hasAbortController = hasAbortController;
|
51 |
|
\ | No newline at end of file |