Objects with computed properties returned from an extended prisma client return true for any property name when calling hasOwn or hasOwnProperty on it #18462
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: clientExtensions
Milestone
Bug description
Objects with computed properties returned from an extended prisma client return true for any property name when calling
.hasOwn
or.hasOwnProperty
on it.Spreading the returned object into a new object and then running
.hasOwn
or.hasOwnProperty
again with any property name works as expected, returning false for names that don't exist in the object.Does this have something to do with the returned object being a proxy when it has a computed property from $extends on it?
How to reproduce
OR
Run the following code (replace post with any prisma model)
Expected behavior
.hasOwn
and.hasOwnProperty
should not always return true, only when the property name actually exists on the returned object.Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: