zod-nest 2.1.4 → 2.1.5

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/index.js CHANGED
@@ -2357,11 +2357,24 @@ var inlineAnonymousBodies = /* @__PURE__ */ __name(({ doc, registry }) => {
2357
2357
  if (bodyByRef.size === 0) {
2358
2358
  return;
2359
2359
  }
2360
+ for (const ref of refsWithin(schemas, bodyByRef)) {
2361
+ bodyByRef.delete(ref);
2362
+ }
2360
2363
  inlineRefs(doc.paths, bodyByRef);
2361
2364
  for (const ref of bodyByRef.keys()) {
2362
2365
  delete schemas[ref.slice(COMPONENTS_SCHEMAS_PREFIX.length)];
2363
2366
  }
2364
2367
  }, "inlineAnonymousBodies");
2368
+ var refsWithin = /* @__PURE__ */ __name((schemas, bodyByRef) => {
2369
+ const found = /* @__PURE__ */ new Set();
2370
+ walkRefs(schemas, (ref) => {
2371
+ if (bodyByRef.has(ref)) {
2372
+ found.add(ref);
2373
+ }
2374
+ return void 0;
2375
+ });
2376
+ return found;
2377
+ }, "refsWithin");
2365
2378
  var isPlainRecord4 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isPlainRecord");
2366
2379
  var inlineRefs = /* @__PURE__ */ __name((node, bodyByRef) => {
2367
2380
  if (Array.isArray(node)) {