You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using postgres.js and sometimes want to return a RowList, which is an Array, extended with some additional properties.
When returning an Array with additional properties in hono, it will not be resolved as a simple Array (even though the JSON transformation will remove the additional properties).
This means if you have the following object and you do JSON.stringify, the value will be [1, 2, 3], which means the type should also be number[], right?
@yusukebe Yeah, I would expect it to be the same as the the one without the additional properties, a simple Array. As long as your code (and the typescript) detects the type to be an array the output will loose all additional properties anyway when being stringified.
What version of Hono are you using?
6.6.10
What runtime/platform is your app running on? (with version if possible)
Browser
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
We are using
postgres.js
and sometimes want to return a RowList, which is an Array, extended with some additional properties.When returning an Array with additional properties in hono, it will not be resolved as a simple Array (even though the JSON transformation will remove the additional properties).
So in this case, the frontend code will expect the returned Response to have a property
meta
, even though it will be stripped in transport. This was working as expected in an earlier version. See https://github.com/honojs/hono/blob/2d0135956c96e00fee48fb5faf287dbc9daf7f4f/src/utils/types.tsThe text was updated successfully, but these errors were encountered: