-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow users to provide type hints to Value.from() #620
Labels
Comments
Similarly I was hoping to be able to say |
This was referenced Mar 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently,
Value.from
converts all JS arrays intoion.dom.List
s and allUint8Array
s intoion.dom.Blob
s. Users hoping to createion.dom.SExpression
orion.dom.Clob
have to instantiate them manually, which is much more tedious.We should modify
Value.from
to accept an optional expected type hint. This is trivial for handling the top level value:However, it's unclear how to specify the expected outcome of converting nested JS values. Would the
expectedType
hint apply to ALLArray
s andUint8Array
s encountered during conversion? Is there a better API?The text was updated successfully, but these errors were encountered: