INNER CODE UNIT · TypeScript

loadRuntimeConfig

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

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}`,
    );
  }
  const value: unknown = await response.json();
  if (!isRuntimeConfig(value)) {
    throw new Error('Invalid playground runtime config');
  }
  return value;
}

function configureWorkerFactory(logger?: ILogger): void {
  const workerLoaders = defineDefaultWorkerLoaders();
  workerLoaders['extensionHostWorkerMain'] = undefined;
  const config = logger !== undefined ? { workerLoaders, logger } : { workerLoaders };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…