Why is my nested seal clone still modifying the master vault?
function createSealedRecord(template) {
const clone = Object.assign(
Object.create(Object.getPrototypeOf(template)),
template
);
return Object.freeze(clone);
}
const vault = { access: { level: "top-secret" }, code: 404 };
const backup = createSealedRecord(vault);
backup.access.level = "guest";
Reply with what is broken and how you would fix it.