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
17 lines (16 loc) • 737 B
JavaScript
import { loadEnv } from "@sanity/cli";
import { createCliConfig, defineCliConfig, getCliClient } from "@sanity/cli";
const envPrefix = "SANITY_STUDIO_";
function getStudioEnvironmentVariables(options = {}) {
const { prefix = "", envFile = !1, jsonEncode = !1 } = options, fullEnv = envFile ? { ...process.env, ...loadEnv(envFile.mode, envFile.envDir || process.cwd(), [envPrefix]) } : process.env, studioEnv = {};
for (const key in fullEnv)
key.startsWith(envPrefix) && (studioEnv[`${prefix}${key}`] = jsonEncode ? JSON.stringify(fullEnv[key] || "") : fullEnv[key] || "");
return studioEnv;
}
export {
createCliConfig,
defineCliConfig,
getCliClient,
getStudioEnvironmentVariables
};
//# sourceMappingURL=cli.esm.js.map