@fern-api/fdr-sdk 1.2.66-2ec4f56478 → 1.2.66-b70af6724f

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.
@@ -8404,11 +8404,9 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
8404
8404
  expandTypeIds(typeIds) {
8405
8405
  const visitedTypeIds = /* @__PURE__ */ new Set();
8406
8406
  const queue = Array.from(typeIds);
8407
- const enqueuedTypeIds = new Set(typeIds);
8408
- const maxIterations = Object.keys(this.api.types).length + typeIds.size;
8409
8407
  let loop = 0;
8410
8408
  while (queue.length > 0) {
8411
- if (loop++ > maxIterations) {
8409
+ if (loop > LARGE_LOOP_TOLERANCE + typeIds.size) {
8412
8410
  throw new Error("Infinite loop detected while expanding type references.");
8413
8411
  }
8414
8412
  const typeId = queue.pop();
@@ -8417,13 +8415,11 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
8417
8415
  const type = this.api.types[typeId];
8418
8416
  if (type) {
8419
8417
  ApiTypeIdVisitor.visitTypeDefinition(type, (nestedTypeId) => {
8420
- if (!enqueuedTypeIds.has(nestedTypeId) && this.api.types[nestedTypeId] != null) {
8421
- enqueuedTypeIds.add(nestedTypeId);
8422
- queue.push(nestedTypeId);
8423
- }
8418
+ queue.push(nestedTypeId);
8424
8419
  });
8425
8420
  }
8426
8421
  }
8422
+ loop++;
8427
8423
  }
8428
8424
  return visitedTypeIds;
8429
8425
  }