@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.
package/dist/js/index.mjs CHANGED
@@ -3247,11 +3247,9 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3247
3247
  expandTypeIds(typeIds) {
3248
3248
  const visitedTypeIds = /* @__PURE__ */ new Set();
3249
3249
  const queue = Array.from(typeIds);
3250
- const enqueuedTypeIds = new Set(typeIds);
3251
- const maxIterations = Object.keys(this.api.types).length + typeIds.size;
3252
3250
  let loop = 0;
3253
3251
  while (queue.length > 0) {
3254
- if (loop++ > maxIterations) {
3252
+ if (loop > LARGE_LOOP_TOLERANCE + typeIds.size) {
3255
3253
  throw new Error("Infinite loop detected while expanding type references.");
3256
3254
  }
3257
3255
  const typeId = queue.pop();
@@ -3260,13 +3258,11 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
3260
3258
  const type = this.api.types[typeId];
3261
3259
  if (type) {
3262
3260
  ApiTypeIdVisitor.visitTypeDefinition(type, (nestedTypeId) => {
3263
- if (!enqueuedTypeIds.has(nestedTypeId) && this.api.types[nestedTypeId] != null) {
3264
- enqueuedTypeIds.add(nestedTypeId);
3265
- queue.push(nestedTypeId);
3266
- }
3261
+ queue.push(nestedTypeId);
3267
3262
  });
3268
3263
  }
3269
3264
  }
3265
+ loop++;
3270
3266
  }
3271
3267
  return visitedTypeIds;
3272
3268
  }