/** * The revision a save line text names: « Révision n » or « Enregistré · révision n ». The * unsaved forms name none, so a reading taken while changes are pending throws instead of * answering NaN. */ export function shownRevision(text: string): number { const found = /révision (\d+)/i.exec(text) if (!found) throw new Error(`The save line shows no revision: « ${text} »`) return Number(found[1]) }