previousRelease
The release of pkg this one follows: its newest one in this branch's history.
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import type { Release } from "#codebase/tcmts/store"; export function previousRelease(cb: Codebase, pkg: string, head = cb.store.head()): Release | undefined { return cb.store.releases(pkg).find((r) => cb.store.isAncestor(r.causal, head)); }