INNER CODE UNIT · TypeScript

isRuntimeConfig

prisma/prisma · apps/lsp-playground/src/client/main.ts:67

function isRuntimeConfig(value: unknown): value is RuntimeConfig {
  return (
    isRecord(value) &&
    typeof value['wsPath'] === 'string' &&
    typeof value['documentUri'] === 'string' &&
    typeof value['rootUri'] === 'string' &&
    typeof value['schemaPath'] === 'string' &&
    typeof value['schemaText'] === 'string'
  );
}

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}`,
    );
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…