mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
26 lines
674 B
TypeScript
26 lines
674 B
TypeScript
// oxlint-disable no-explicit-any -- window.env is a server-injected boundary with mixed value types
|
|
declare global {
|
|
interface Window {
|
|
env: Record<string, any>;
|
|
}
|
|
}
|
|
|
|
if (!window.env) {
|
|
throw new Error(
|
|
"Config could not be parsed. \nSee: https://docs.getoutline.com/s/hosting/doc/troubleshooting-HXckrzCqDJ#h-config-could-not-be-parsed"
|
|
);
|
|
}
|
|
|
|
const env: Record<string, any> & {
|
|
isDevelopment: boolean;
|
|
isTest: boolean;
|
|
isProduction: boolean;
|
|
} = {
|
|
...window.env,
|
|
isDevelopment: window.env.ENVIRONMENT === "development",
|
|
isTest: window.env.ENVIRONMENT === "test",
|
|
isProduction: window.env.ENVIRONMENT === "production",
|
|
};
|
|
|
|
export default env;
|