INNER CODE UNIT · TypeScript

isRecord

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

function isRecord(value: unknown): value is Record<string, unknown> {
  return typeof value === 'object' && value !== null;
}

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) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…