utilsBundle.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __copyProps = (to, from, except, desc) => {
  11. if (from && typeof from === "object" || typeof from === "function") {
  12. for (let key of __getOwnPropNames(from))
  13. if (!__hasOwnProp.call(to, key) && key !== except)
  14. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  15. }
  16. return to;
  17. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. var utilsBundle_exports = {};
  20. __export(utilsBundle_exports, {
  21. HttpsProxyAgent: () => HttpsProxyAgent,
  22. PNG: () => PNG,
  23. ProgramOption: () => ProgramOption,
  24. SocksProxyAgent: () => SocksProxyAgent,
  25. colors: () => colors,
  26. debug: () => debug,
  27. diff: () => diff,
  28. dotenv: () => dotenv,
  29. getProxyForUrl: () => getProxyForUrl,
  30. jpegjs: () => jpegjs,
  31. lockfile: () => lockfile,
  32. mime: () => mime,
  33. minimatch: () => minimatch,
  34. ms: () => ms,
  35. open: () => open,
  36. program: () => program,
  37. progress: () => progress,
  38. ws: () => ws,
  39. wsReceiver: () => wsReceiver,
  40. wsSender: () => wsSender,
  41. wsServer: () => wsServer,
  42. yaml: () => yaml
  43. });
  44. module.exports = __toCommonJS(utilsBundle_exports);
  45. const colors = require("./utilsBundleImpl").colors;
  46. const debug = require("./utilsBundleImpl").debug;
  47. const diff = require("./utilsBundleImpl").diff;
  48. const dotenv = require("./utilsBundleImpl").dotenv;
  49. const getProxyForUrl = require("./utilsBundleImpl").getProxyForUrl;
  50. const HttpsProxyAgent = require("./utilsBundleImpl").HttpsProxyAgent;
  51. const jpegjs = require("./utilsBundleImpl").jpegjs;
  52. const lockfile = require("./utilsBundleImpl").lockfile;
  53. const mime = require("./utilsBundleImpl").mime;
  54. const minimatch = require("./utilsBundleImpl").minimatch;
  55. const open = require("./utilsBundleImpl").open;
  56. const PNG = require("./utilsBundleImpl").PNG;
  57. const program = require("./utilsBundleImpl").program;
  58. const ProgramOption = require("./utilsBundleImpl").ProgramOption;
  59. const progress = require("./utilsBundleImpl").progress;
  60. const SocksProxyAgent = require("./utilsBundleImpl").SocksProxyAgent;
  61. const ws = require("./utilsBundleImpl").ws;
  62. const wsServer = require("./utilsBundleImpl").wsServer;
  63. const wsReceiver = require("./utilsBundleImpl").wsReceiver;
  64. const wsSender = require("./utilsBundleImpl").wsSender;
  65. const yaml = require("./utilsBundleImpl").yaml;
  66. function ms(ms2) {
  67. if (!isFinite(ms2))
  68. return "-";
  69. if (ms2 === 0)
  70. return "0ms";
  71. if (ms2 < 1e3)
  72. return ms2.toFixed(0) + "ms";
  73. const seconds = ms2 / 1e3;
  74. if (seconds < 60)
  75. return seconds.toFixed(1) + "s";
  76. const minutes = seconds / 60;
  77. if (minutes < 60)
  78. return minutes.toFixed(1) + "m";
  79. const hours = minutes / 60;
  80. if (hours < 24)
  81. return hours.toFixed(1) + "h";
  82. const days = hours / 24;
  83. return days.toFixed(1) + "d";
  84. }
  85. // Annotate the CommonJS export names for ESM import in node:
  86. 0 && (module.exports = {
  87. HttpsProxyAgent,
  88. PNG,
  89. ProgramOption,
  90. SocksProxyAgent,
  91. colors,
  92. debug,
  93. diff,
  94. dotenv,
  95. getProxyForUrl,
  96. jpegjs,
  97. lockfile,
  98. mime,
  99. minimatch,
  100. ms,
  101. open,
  102. program,
  103. progress,
  104. ws,
  105. wsReceiver,
  106. wsSender,
  107. wsServer,
  108. yaml
  109. });