1import { throwIf } from '../throwErrorF/throwIfF.mts'23export function assertSingleItem<T>(arr: T[], debugCtx?: Record<string, unknown>): asserts arr is [T] {4 throwIf(() => arr.length !== 1, {length: arr.length, ...debugCtx})5}6