Loading homepage
Input: update({ user: { score: 1 }, tags: ["a"] }, { user: { score: { $apply: n => n + 1 } }, tags: { $push: ["b"] } }); Output: { user: { score: 2 }, tags: ["a", "b"] }
Input: const original = { x: 1 }; update(original, { x: { $set: 1 } }) === original; Output: true
Implement the exported API in index.js or index.ts. Tests cover the contract and edge cases below.