@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.
@@ -3016,11 +3016,9 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3016
3016
  expandTypeIds(typeIds) {
3017
3017
  const visitedTypeIds = /* @__PURE__ */ new Set();
3018
3018
  const queue = Array.from(typeIds);
3019
- const enqueuedTypeIds = new Set(typeIds);
3020
- const maxIterations = Object.keys(this.api.types).length + typeIds.size;
3021
3019
  let loop = 0;
3022
3020
  while (queue.length > 0) {
3023
- if (loop++ > maxIterations) {
3021
+ if (loop > LARGE_LOOP_TOLERANCE + typeIds.size) {
3024
3022
  throw new Error("Infinite loop detected while expanding type references.");
3025
3023
  }
3026
3024
  const typeId = queue.pop();
@@ -3029,13 +3027,11 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3029
3027
  const type = this.api.types[typeId];
3030
3028
  if (type) {
3031
3029
  ApiTypeIdVisitor.visitTypeDefinition(type, (nestedTypeId) => {
3032
- if (!enqueuedTypeIds.has(nestedTypeId) && this.api.types[nestedTypeId] != null) {
3033
- enqueuedTypeIds.add(nestedTypeId);
3034
- queue.push(nestedTypeId);
3035
- }
3030
+ queue.push(nestedTypeId);
3036
3031
  });
3037
3032
  }
3038
3033
  }
3034
+ loop++;
3039
3035
  }
3040
3036
  return visitedTypeIds;
3041
3037
  }