stateOf

tcmts.cli.diff.stateOf · #hccbjsis · term · runs anywhere

import { stateKey } from "#codebase/tcmts/cli/diff";
import type { NameState } from "#codebase/tcmts/cli/diff";
import type { NameRow } from "#codebase/tcmts/store";

export function stateOf(rows: NameRow[]): NameState {
  const s: NameState = new Map();
  for (const r of rows) s.set(stateKey(r.path, r.kind), (s.get(stateKey(r.path, r.kind)) ?? new Set()).add(r.hash));
  return s;
}

uses

used by