INNER CODE UNIT · TypeScript
isRuntimeConfig
prisma/orm · apps/lsp-playground/src/client/main.ts:92
function isRuntimeConfig(value: unknown): value is RuntimeConfig {
return (
isRecord(value) &&
typeof value['wsPath'] === 'string' &&
typeof value['rootUri'] === 'string' &&
typeof value['scratchRootUri'] === 'string' &&
Array.isArray(value['members']) &&
value['members'].every(isRuntimeMember)
);
}
async function loadRuntimeConfig(): Promise<RuntimeConfig> {
const response = await fetch(RUNTIME_CONFIG_PATH, { cache: 'no-store' });
if (!response.ok) {
throw new Error(
`Failed to load playground runtime config: ${response.status} ${response.statusText}`,
);
}