@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.
@@ -8443,11 +8443,9 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
8443
8443
  expandTypeIds(typeIds) {
8444
8444
  const visitedTypeIds = /* @__PURE__ */ new Set();
8445
8445
  const queue = Array.from(typeIds);
8446
- const enqueuedTypeIds = new Set(typeIds);
8447
- const maxIterations = Object.keys(this.api.types).length + typeIds.size;
8448
8446
  let loop = 0;
8449
8447
  while (queue.length > 0) {
8450
- if (loop++ > maxIterations) {
8448
+ if (loop > LARGE_LOOP_TOLERANCE + typeIds.size) {
8451
8449
  throw new Error("Infinite loop detected while expanding type references.");
8452
8450
  }
8453
8451
  const typeId = queue.pop();
@@ -8456,13 +8454,11 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
8456
8454
  const type = this.api.types[typeId];
8457
8455
  if (type) {
8458
8456
  ApiTypeIdVisitor.visitTypeDefinition(type, (nestedTypeId) => {
8459
- if (!enqueuedTypeIds.has(nestedTypeId) && this.api.types[nestedTypeId] != null) {
8460
- enqueuedTypeIds.add(nestedTypeId);
8461
- queue.push(nestedTypeId);
8462
- }
8457
+ queue.push(nestedTypeId);
8463
8458
  });
8464
8459
  }
8465
8460
  }
8461
+ loop++;
8466
8462
  }
8467
8463
  return visitedTypeIds;
8468
8464
  }