utilsBundle.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. SocksProxyAgent: () => SocksProxyAgent,
  24. colors: () => colors,
  25. debug: () => debug,
  26. diff: () => diff,
  27. dotenv: () => dotenv,
  28. getProxyForUrl: () => getProxyForUrl,
  29. jpegjs: () => jpegjs,
  30. lockfile: () => lockfile,
  31. mime: () => mime,
  32. minimatch: () => minimatch,
  33. ms: () => ms,
  34. open: () => open,
  35. program: () => program,
  36. progress: () => progress,
  37. ws: () => ws,
  38. wsReceiver: () => wsReceiver,
  39. wsSender: () => wsSender,
  40. wsServer: () => wsServer,
  41. yaml: () => yaml
  42. });
  43. module.exports = __toCommonJS(utilsBundle_exports);
  44. const colors = require("./utilsBundleImpl").colors;
  45. const debug = require("./utilsBundleImpl").debug;
  46. const diff = require("./utilsBundleImpl").diff;
  47. const dotenv = require("./utilsBundleImpl").dotenv;
  48. const getProxyForUrl = require("./utilsBundleImpl").getProxyForUrl;
  49. const HttpsProxyAgent = require("./utilsBundleImpl").HttpsProxyAgent;
  50. const jpegjs = require("./utilsBundleImpl").jpegjs;
  51. const lockfile = require("./utilsBundleImpl").lockfile;
  52. const mime = require("./utilsBundleImpl").mime;
  53. const minimatch = require("./utilsBundleImpl").minimatch;
  54. const open = require("./utilsBundleImpl").open;
  55. const PNG = require("./utilsBundleImpl").PNG;
  56. const program = require("./utilsBundleImpl").program;
  57. const progress = require("./utilsBundleImpl").progress;
  58. const SocksProxyAgent = require("./utilsBundleImpl").SocksProxyAgent;
  59. const yaml = require("./utilsBundleImpl").yaml;
  60. const ws = require("./utilsBundleImpl").ws;
  61. const wsServer = require("./utilsBundleImpl").wsServer;
  62. const wsReceiver = require("./utilsBundleImpl").wsReceiver;
  63. const wsSender = require("./utilsBundleImpl").wsSender;
  64. function ms(ms2) {
  65. if (!isFinite(ms2))
  66. return "-";
  67. if (ms2 === 0)
  68. return "0ms";
  69. if (ms2 < 1e3)
  70. return ms2.toFixed(0) + "ms";
  71. const seconds = ms2 / 1e3;
  72. if (seconds < 60)
  73. return seconds.toFixed(1) + "s";
  74. const minutes = seconds / 60;
  75. if (minutes < 60)
  76. return minutes.toFixed(1) + "m";
  77. const hours = minutes / 60;
  78. if (hours < 24)
  79. return hours.toFixed(1) + "h";
  80. const days = hours / 24;
  81. return days.toFixed(1) + "d";
  82. }
  83. // Annotate the CommonJS export names for ESM import in node:
  84. 0 && (module.exports = {
  85. HttpsProxyAgent,
  86. PNG,
  87. SocksProxyAgent,
  88. colors,
  89. debug,
  90. diff,
  91. dotenv,
  92. getProxyForUrl,
  93. jpegjs,
  94. lockfile,
  95. mime,
  96. minimatch,
  97. ms,
  98. open,
  99. program,
  100. progress,
  101. ws,
  102. wsReceiver,
  103. wsSender,
  104. wsServer,
  105. yaml
  106. });