react-server675fbba4
react-serverfilespackagesrscserverreply-decoder.mjs
packages/rsc/server/reply-decoder.mjsmjs27.3 KiB225738dd
    path: "0",
  });
  const root = getChunk(response, 0);
  initializeModelChunk(response, root);
  if (root.status === REJECTED) throw root.reason;
  return root.value;
}

/**
 * High-level entry point.
 */
export async function decodeReply(body, options = {}) {
  if (typeof body === "string") {
    return decodeReplyFromString(body, options);
  }
  if (body instanceof FormData) {
    return decodeReplyFromFormData(body, options);
  }
  throw new DecodeError("Invalid body type for decodeReply");
}