@sanity/client
Version:
Client for retrieving, creating and patching data from Sanity.io
31 lines (30 loc) • 1.5 kB
JavaScript
import { n as vercelStegaCleanAll, t as stegaClean } from "./stegaClean-C18wLWau.js";
import { r as encodeIntoResult, t as stegaEncodeSourceMap } from "./stegaEncodeSourceMap-YR3NQ3iz.js";
import { ObservableSanityClient, SanityClient, createClient as createClient$1, requester as requester$1 } from "@sanity/client";
export * from "@sanity/client";
/**
* Marks strings in an already fetched query result as potentially containing stega-encoded data,
* by re-typing them as `StegaString`. Comparing branded strings to string literals is a type error
* until they're cleaned with `stegaClean()`, which recovers the original type.
*
* This is an identity function, it only changes the type of the input, not its value.
* Prefer passing `ClientReturnStega` as the first generic to `client.fetch` when possible, and use
* this function for data that has already been fetched.
*
* @beta
*/
function stegaBrand(result) {
return result;
}
/**
* @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead
* @public
*/
var SanityStegaClient = class extends SanityClient {}, ObservableSanityStegaClient = class extends ObservableSanityClient {};
/**
* @deprecated -- Use `import {requester} from '@sanity/client'` instead
* @public
*/
const requester = requester$1, createClient = createClient$1;
export { ObservableSanityStegaClient, SanityStegaClient, createClient, encodeIntoResult, requester, stegaBrand, stegaClean, stegaEncodeSourceMap, vercelStegaCleanAll };
//# sourceMappingURL=stega.js.map