Closed ersinakinci closed 4 months ago
Interesting. I messed around a bit and found that setting maintainNestedObjectKeys: true
on the plugin config results in the type mapping working correctly.
Here's the culprit: https://github.com/kysely-org/kysely/blob/9519ffd2b6ebb6a3e6ed95724f8c171fc4bec6cc/src/plugin/camel-case/camel-case-plugin.ts#L171-L176
isPlainObject
is too permissive. https://github.com/kysely-org/kysely/pull/1037 addresses the issue.
I'm using Postgres and the
pg
driver, and I want to mapnumeric
to complex objects using bignumber.js:However, when I use CamelCasePlugin, it seems to serialize my mapped values and strip them of any methods:
I originally created an issue upstream before realizing that CamelCasePlugin was the culprit.