@nsshunt/stsconfig 1.25.152 → 1.25.154

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.
@@ -1,9 +1,7 @@
1
+ import * as fs from "node:fs";
1
2
  import * as dotenv from "dotenv";
2
- const __viteBrowserExternal = {};
3
- const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4
- __proto__: null,
5
- default: __viteBrowserExternal
6
- }, Symbol.toStringTag, { value: "Module" }));
3
+ import http from "node:http";
4
+ import https from "node:https";
7
5
  function getDefaultExportFromCjs(x) {
8
6
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
9
7
  }
@@ -1652,9 +1650,35 @@ const envOptionsHandler = {
1652
1650
  }
1653
1651
  };
1654
1652
  const goptions = new Proxy(envOptions, envOptionsHandler);
1653
+ function GetAgent(protocol) {
1654
+ if (protocol.toLowerCase().startsWith("https:")) {
1655
+ return new https.Agent({
1656
+ keepAlive: process.env.NODE_ENV === "test" ? false : goptions.keepAlive,
1657
+ maxSockets: goptions.maxSockets,
1658
+ maxTotalSockets: goptions.maxTotalSockets,
1659
+ maxFreeSockets: goptions.maxFreeSockets,
1660
+ timeout: 3e4,
1661
+ //@@ config
1662
+ rejectUnauthorized: goptions.isProduction
1663
+ // Allows self signed certs in non production mode(s)
1664
+ });
1665
+ } else if (protocol.toLowerCase().startsWith("http:")) {
1666
+ return new http.Agent({
1667
+ keepAlive: process.env.NODE_ENV === "test" ? false : goptions.keepAlive,
1668
+ maxSockets: goptions.maxSockets,
1669
+ maxTotalSockets: goptions.maxTotalSockets,
1670
+ maxFreeSockets: goptions.maxFreeSockets,
1671
+ timeout: 3e4
1672
+ //@@ config
1673
+ });
1674
+ } else {
1675
+ return null;
1676
+ }
1677
+ }
1655
1678
  export {
1656
1679
  $ResetOptions,
1657
1680
  $ResetOptionsEx,
1681
+ GetAgent,
1658
1682
  goptions
1659
1683
  };
1660
1684
  //# sourceMappingURL=stsconfig.mjs.map