INNER CODE UNIT · TypeScript

isRuntimeMember

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

function isRuntimeMember(value: unknown): value is RuntimeMember {
  return isRecord(value) && typeof value['uri'] === 'string' && typeof value['text'] === 'string';
}

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…