Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): Allow calling toString and valueOf on the proxy object #2510

Merged
merged 1 commit into from
Apr 17, 2024

Commits on Apr 17, 2024

  1. Allow calling toString and valueOf on the proxy object

    Fixes honojs#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 facebook/hermes#205
    ibash committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    a986ee6 View commit details
    Browse the repository at this point in the history