kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.44k stars 267 forks source link

Go up prototype chain when checking isPlainObject #1037

Closed ersinakinci closed 3 months ago

ersinakinci commented 3 months ago

Implement a more robust version of isPlainObject that checks the prototype chain, inspired by Lodash's isPlainObject.

Fixes https://github.com/kysely-org/kysely/issues/1036.

Sorry for not writing a test, I'm a first-time contributor and the idea of adding a test for my particular use case--complex objects returned from PG.types.setTypeMapParser--was daunting. However, all tests pass on my machine.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 5:48pm
koskimas commented 3 months ago

Can't merge untested code. Especially for such a crucial function.

koskimas commented 3 months ago

Fixed in master.