@apicircle/core 1.0.4 → 1.0.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
@@ -4476,10 +4476,10 @@ function collectAttachmentSlots(synced) {
4476
4476
  for (const server of Object.values(synced.mockServers ?? {})) {
4477
4477
  for (const endpoint of server.endpoints) {
4478
4478
  collectMockResponseAttachment(endpoint.defaultResponse, seen);
4479
- for (const rule of endpoint.requestValidation) {
4479
+ for (const rule of endpoint.requestValidation ?? []) {
4480
4480
  collectMockResponseAttachment(rule.failResponse, seen);
4481
4481
  }
4482
- for (const rule of endpoint.responseRules) {
4482
+ for (const rule of endpoint.responseRules ?? []) {
4483
4483
  collectMockResponseAttachment(rule.response, seen);
4484
4484
  }
4485
4485
  }
@@ -4498,10 +4498,10 @@ function collectAttachmentSlots(synced) {
4498
4498
  return [...seen.values()];
4499
4499
  }
4500
4500
  function collectMockResponseAttachment(response, seen) {
4501
- collectMockResponseBodyAttachment(response.body, seen);
4501
+ collectMockResponseBodyAttachment(response?.body, seen);
4502
4502
  }
4503
4503
  function collectMockResponseBodyAttachment(body, seen) {
4504
- if (body.type !== "binary") return;
4504
+ if (body?.type !== "binary") return;
4505
4505
  const ref = body.attachment;
4506
4506
  if (!ref?.slotId || seen.has(ref.slotId)) return;
4507
4507
  seen.set(ref.slotId, {