Loading homepage
Track committed values with undo, redo, branching history, and reset controls.
Input: const history = new UndoRedoManager("A"); history.set("B"); history.set("C"); history.undo(); history.redo(); Output: undo returns "B"; redo returns "C".
Input: history.undo(); history.set("D"); history.redo(); Output: The old "C" branch is discarded; redo returns "D".
Implement the exported class in index.js or index.ts. Tests provide fixtures for the required behavior.