prisma-factory icon indicating copy to clipboard operation
prisma-factory copied to clipboard

Passing `null` or `undefined` fails without a helpful error

Open DominicSherman opened this issue 3 years ago • 1 comments

Might not want to allow it, but if so should update the type definition to explicitly disallow it or throw a more helpful error

DominicSherman avatar May 20 '22 15:05 DominicSherman

I think the issue comes from the fact that undefined properties of objects are still properties of the object:

if(o.myProperty === undefined) {
  alert("myProperty value is the special value `undefined`");
}

// versus...

if(!o.hasOwnProperty('myProperty')) {
  alert("myProperty does not exist");
}

andrewmclagan avatar Oct 11 '22 20:10 andrewmclagan