Is there any helper method or shortcut to deal wit...
# orm-help
t
Is there any helper method or shortcut to deal with the
Enumerable
typed properties so I can always deal with them as arrays? Same question with
XOR
is there any helper methods to assist in working with it. This relates to the above question because I am piping my upsert records into another stream processor to attempt to upsert any related records prior to running the upsert on the main records.
r
I didn’t quite get your question, could you share an example?
t
for Enumerable, I ended up with
Copy code
const enumerableToArray = <T>(value: Prisma.Enumerable<T>): Array<T> => {
  return Array.isArray(value) ? value : [value];
};
I was trying to parse out a preexisting list WhereInput to "pre-create" the records from the connectOrCreate that were giving me the duplicate key errrors. I ended up not having to deal with the XOR in a programmatic way
👍 1