mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 14:38:50 +00:00
fix: Return correct scalar value
This commit is contained in:
1 parent
4d07862601
commit
21ded71fde
1 file changed
+1
-1
@@ -21,7 +21,7 @@ export const parseResponse = (type: QueryType, result: QueryResponse): QueryResp
|
|||||||
return isRowDataPacket(result) ? result[0] : null;
|
return isRowDataPacket(result) ? result[0] : null;
|
||||||
|
|
||||||
case 'scalar':
|
case 'scalar':
|
||||||
return isRowDataPacketArray(result) ? result[0][0] : null;
|
return isRowDataPacketArray(result) ? Object.values(result[0])[0] : null;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return result || null;
|
return result || null;
|
||||||
|
|||||||
Reference in new issue
Block a user