the query it returns an array with first element as result from database but it has different types
RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader
and to avoid compile time errors I typecasted the result variable. A wise man told me to avoid doing typecast like this, Is there any other way to tell the type to typescript ?
use typeguards
Thanks mate 👍
Обсуждают сегодня