Skip to content

Commit

Permalink
fix: Return correct scalar value
Browse files Browse the repository at this point in the history
  • Loading branch information
dunak-debug committed Jan 7, 2022
1 parent 4d07862 commit 21ded71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/parseResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const parseResponse = (type: QueryType, result: QueryResponse): QueryResp
return isRowDataPacket(result) ? result[0] : null;

case 'scalar':
return isRowDataPacketArray(result) ? result[0][0] : null;
return isRowDataPacketArray(result) ? Object.values(result[0])[0] : null;

default:
return result || null;
Expand Down

0 comments on commit 21ded71

Please sign in to comment.