INNER CODE UNIT · TypeScript

strandedJudgments

runvendo/vendo · packages/vendo/src/actions/sync/index.ts:276

function strandedJudgments(tools: readonly ExtractedTool[], judgments: JudgmentsFile | null): string[] {
  if (judgments === null) return [];
  const stranded: Array<{ name: string; was: string; now: string }> = [];
  let judged = 0;
  for (const tool of [...tools].sort((a, b) => a.name.localeCompare(b.name))) {
    const judgment = judgments.tools[tool.name];
    if (judgment === undefined) continue;
    judged += 1;
    const now = bindingIdentity(tool.binding);
    if (judgment.binding === now) continue;
    stranded.push({ name: tool.name, was: judgment.binding, now });
  }
  const first = stranded[0];
  if (first === undefined) return [];
  const names = stranded.map(({ name }) => name);
  const shown = names.slice(0, 6).join(", ");
  // Out of the tools that CARRY a judgment, not the whole catalog: "3/30" would
  // read as thirty judgments and understate a total break.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…