The constructor of each object should either be in globalThis (and have a name property that matches
the key) or be specified in locals. They should be accessible to both serialise() and deserialise().
an object with an entry for each object or a Map mapping the name to its constructor
function. Note that this Map is the opposite to the one passed to serialise(). If an object is passed,
it is immediately converted to a Map.