@sanity/client 6.24.0 → 6.24.1
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.browser.cjs +3 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +3 -1
- package/dist/index.browser.d.ts +3 -1
- package/dist/index.browser.js +3 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +3 -1
- package/umd/sanityClient.js +3 -2
- package/umd/sanityClient.min.js +1 -1
package/dist/index.browser.cjs
CHANGED
|
@@ -207,7 +207,7 @@ function validateApiVersion(apiVersion) {
|
|
|
207
207
|
if (!(/^\d{4}-\d{2}-\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0))
|
|
208
208
|
throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
function validateApiPerspective(perspective) {
|
|
211
211
|
if (Array.isArray(perspective)) {
|
|
212
212
|
for (const perspectiveValue of perspective)
|
|
213
213
|
if (perspectiveValue !== "published" && perspectiveValue !== "drafts" && !(typeof perspectiveValue == "string" && perspectiveValue.startsWith("r") && perspectiveValue !== "raw"))
|
|
@@ -227,7 +227,8 @@ const validateApiPerspective = function(perspective) {
|
|
|
227
227
|
"Invalid API perspective string, expected `published`, `previewDrafts` or `raw`"
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
|
-
}
|
|
230
|
+
}
|
|
231
|
+
const initConfig = (config, prevConfig) => {
|
|
231
232
|
const specifiedConfig = {
|
|
232
233
|
...prevConfig,
|
|
233
234
|
...config,
|