fix(client): Allow calling toString and valueOf on the proxy object (#2510)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fixes #2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see https://github.com/facebook/hermes/issues/205
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+64 added−2 removed
- tests:+24 added−0 removed
- other:+40 added−2 removed