orchid-orm
orchid-orm copied to clipboard
`narrowType` doesn't work with `get()`
Suppose I want to narrow a type but return in get:
db.book.find(1).get('name').narrowType()<number>()
the type is ignored:
This doesn't work either:
db.book.find(1).narrowType()<{ name: number }>().get('name')
I could just use as number, but the get could also be part of a subquery.
I published a fix:
// 1st is supported now:
db.book.find(1).get('name').narrowType()<number>()
// 2nd is not supported,`get` isn't aware of previously narrowed types:
db.book.find(1).narrowType()<{ name: number }>().get('name')