Create a generic function with narrowed type in ExpressionBuilder
#1007
Labels
duplicate
This issue or pull request already exists
question
Further information is requested
typescript
Related to Typescript
I am trying to use kysely to narrow a type in a function so I can create a generalise function that accepts string column types (see
filterString
). But typescript is not recognising thevalue
as narrowed to a string type and throwing an error.I've taken the database tables from the docs for an example.
How can I create a generic function that will allow kysely to recognise a narrowed type of a reference expression so I can call it will a string?
The text was updated successfully, but these errors were encountered: