@sanity/client 6.22.2-bundle-perspective → 6.22.2-bundle-perspective-2

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.cjs CHANGED
@@ -536,7 +536,7 @@ const validateApiPerspective = function(perspective) {
536
536
  );
537
537
  }
538
538
  }, validateApiBundlePerspective = function(perspective, bundlePerspective) {
539
- if (perspective !== "raw" && bundlePerspective)
539
+ if (perspective && perspective !== "raw" && bundlePerspective)
540
540
  throw new TypeError(
541
541
  "Invalid, perspective and bundlePerspective parameters are mutually exclusive"
542
542
  );
@@ -761,7 +761,11 @@ function _requestObservable(client, httpRequest, options) {
761
761
  const perspective = options.perspective || config.perspective;
762
762
  typeof perspective == "string" && perspective !== "raw" && (validateApiPerspective(perspective), options.query = { perspective, ...options.query }, perspective === "previewDrafts" && useCdn && (useCdn = !1, printCdnPreviewDraftsWarning()));
763
763
  const bundlePerspective = options.bundlePerspective || config.bundlePerspective;
764
- Array.isArray(bundlePerspective) && bundlePerspective.length > 0 && (validateApiBundlePerspective(perspective, bundlePerspective), options.query = { perspective: void 0, bundlePerspective, ...options.query }), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query });
764
+ Array.isArray(bundlePerspective) && bundlePerspective.length > 0 && (validateApiBundlePerspective(perspective, bundlePerspective), options.query = {
765
+ perspective: void 0,
766
+ bundlePerspective: bundlePerspective.join(","),
767
+ ...options.query
768
+ }), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query });
765
769
  }
766
770
  const reqOptions = requestOptions(
767
771
  config,
@@ -1551,7 +1555,7 @@ function defineDeprecatedCreateClient(createClient2) {
1551
1555
  return printNoDefaultExport(), createClient2(config);
1552
1556
  };
1553
1557
  }
1554
- var name = "@sanity/client", version = "6.22.2-bundle-perspective";
1558
+ var name = "@sanity/client", version = "6.22.2-bundle-perspective-2";
1555
1559
  const middleware = [
1556
1560
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
1557
1561
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),