zod
zod copied to clipboard
v4: The `isPlainObject` fails on objects without a prototype
While it makes sense that objects that are actually instances of something other than Object to not be treated as plain objects, objects can also have no prototype at all (Object.create(null)) which turns out to be something prosemirror likes to use.
With v3 this parsed fine as z.record(z.string(), z.any()) and now fails with Invalid input: expected record, received object.
It'd be great if the isPlainObject check could be expanded to also accept objects without any prototype at all.