UNPKG

1.97 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.httpExecutor = exports.NodeHttpExecutor = void 0;
7
8function _builderUtilRuntime() {
9 const data = require("builder-util-runtime");
10
11 _builderUtilRuntime = function () {
12 return data;
13 };
14
15 return data;
16}
17
18function _http() {
19 const data = require("http");
20
21 _http = function () {
22 return data;
23 };
24
25 return data;
26}
27
28function https() {
29 const data = _interopRequireWildcard(require("https"));
30
31 https = function () {
32 return data;
33 };
34
35 return data;
36}
37
38function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
39
40function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
42class NodeHttpExecutor extends _builderUtilRuntime().HttpExecutor {
43 // noinspection JSMethodCanBeStatic
44 // noinspection JSUnusedGlobalSymbols
45 createRequest(options, callback) {
46 return (options.protocol === "http:" ? _http().request : https().request)(options, callback);
47 }
48
49}
50
51exports.NodeHttpExecutor = NodeHttpExecutor;
52const httpExecutor = new NodeHttpExecutor(); exports.httpExecutor = httpExecutor;
53// __ts-babel@6.0.4
54//# sourceMappingURL=nodeHttpExecutor.js.map
\No newline at end of file