Loading homepage
Input: const db = new UndoableDatabase(); const user = db.create({name:"Ada",email:"ada@example.com"}); db.update(user.id,{name:"Lin"}); db.undo(); db.read(user.id); Output: { id: 1, name: "Ada", email: "ada@example.com" }
Input: db.redo(); db.delete(1); db.undo(); db.list(); Output: The user returns in its original order, with name Lin.
Implement the exported API in index.js or index.ts. The documented contract defines the scope of this exercise.