@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.
@@ -3235,11 +3235,9 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3235
3235
  expandTypeIds(typeIds) {
3236
3236
  const visitedTypeIds = /* @__PURE__ */ new Set();
3237
3237
  const queue = Array.from(typeIds);
3238
- const enqueuedTypeIds = new Set(typeIds);
3239
- const maxIterations = Object.keys(this.api.types).length + typeIds.size;
3240
3238
  let loop = 0;
3241
3239
  while (queue.length > 0) {
3242
- if (loop++ > maxIterations) {
3240
+ if (loop > LARGE_LOOP_TOLERANCE + typeIds.size) {
3243
3241
  throw new Error("Infinite loop detected while expanding type references.");
3244
3242
  }
3245
3243
  const typeId = queue.pop();
@@ -3248,13 +3246,11 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3248
3246
  const type = this.api.types[typeId];
3249
3247
  if (type) {
3250
3248
  ApiTypeIdVisitor.visitTypeDefinition(type, (nestedTypeId) => {
3251
- if (!enqueuedTypeIds.has(nestedTypeId) && this.api.types[nestedTypeId] != null) {
3252
- enqueuedTypeIds.add(nestedTypeId);
3253
- queue.push(nestedTypeId);
3254
- }
3249
+ queue.push(nestedTypeId);
3255
3250
  });
3256
3251
  }
3257
3252
  }
3253
+ loop++;
3258
3254
  }
3259
3255
  return visitedTypeIds;
3260
3256
  }