@strapi/data-transfer 4.22.0 → 4.23.0

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.
package/dist/index.js CHANGED
@@ -3137,8 +3137,11 @@ const transformUpgradeHeader = (header = "") => {
3137
3137
  return header.split(",").map((s) => s.trim().toLowerCase());
3138
3138
  };
3139
3139
  let timeouts;
3140
+ const hasHttpServer = () => {
3141
+ return typeof strapi !== "undefined" && !!strapi?.server?.httpServer;
3142
+ };
3140
3143
  const disableTimeouts = () => {
3141
- if (!strapi?.server?.httpServer) {
3144
+ if (!hasHttpServer()) {
3142
3145
  return;
3143
3146
  }
3144
3147
  const { httpServer } = strapi.server;
@@ -3153,7 +3156,7 @@ const disableTimeouts = () => {
3153
3156
  strapi.log.info("[Data transfer] Disabling http timeouts");
3154
3157
  };
3155
3158
  const resetTimeouts = () => {
3156
- if (!strapi?.server?.httpServer || !timeouts) {
3159
+ if (!hasHttpServer() || !timeouts) {
3157
3160
  return;
3158
3161
  }
3159
3162
  const { httpServer } = strapi.server;