adamjkb / bark

Materialized path extension for Prisma
https://prisma-extension-bark.gitbook.io
MIT License
33 stars 5 forks source link

Improve internal type safety #43

Open adamjkb opened 11 months ago

adamjkb commented 11 months ago

The extension's internal type safety isn't the best it could be. There are a lot of red squigglies. This is part due to Prisma.getExtensionContext not really providing much of a context really other than the 'name' property. While technically it is possible to do client[ctx.name].<prismaMethodName>() it isn't really the whole story. Prisma will likely provide better tools in the future.

There are also a decent amount of squigglies because of a "non typescript" way of going about internal variable assignment. Thinking of:


/** @type {string} */
let path

if (node) {
   path = node.path
   //   ...
} else if (where) {
   // ...
}