sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
18 lines (17 loc) • 676 B
JavaScript
import path from "node:path";
function withMediaLibraryConfig(context) {
const {
cliConfig,
cliConfigPath
} = context, mediaLibrary = typeof cliConfig == "object" && "mediaLibrary" in cliConfig ? cliConfig.mediaLibrary : void 0, relativeConfigPath = path.relative(process.cwd(), cliConfigPath ?? "");
if (typeof mediaLibrary?.aspectsPath > "u")
throw new Error(`${relativeConfigPath} does not contain a media library aspects path ("mediaLibrary.aspectsPath"), which is required for the Sanity CLI to manage aspects.`);
return {
...context,
mediaLibrary
};
}
export {
withMediaLibraryConfig
};
//# sourceMappingURL=withMediaLibraryConfig.js.map