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

Json RPC params are now properly castable to Json type #51

Merged
merged 4 commits into from
Nov 7, 2022
Merged

Conversation

ritave
Copy link
Member

@ritave ritave commented Nov 4, 2022

JsonRpcStruct params was type Record<string, unknown> | unknown[], but in other parts of the code we use Json to denote such structures. unknown is not castable to Json because of undefined and classes. This commit solves the compatibillity issue with other parts of the code

JsonRpcStruct params was type Record<string, unknown> | unknown[], but
in other parts of the code we use Json to denote such structures.
unknown is not castable to Json because of undefined and classes.
This commit solves the compatibillity issue with other parts of the code
@ritave ritave requested a review from a team as a code owner November 4, 2022 14:38
src/json.ts Outdated Show resolved Hide resolved
src/json.ts Outdated Show resolved Hide resolved
Mrtenz
Mrtenz previously approved these changes Nov 7, 2022
@ritave ritave merged commit c10dd08 into main Nov 7, 2022
@ritave ritave deleted the ritave/cast branch November 7, 2022 13:42
@ritave ritave changed the title Cast JsonRPC to Json Json superstruct struct can now be cast to Json type Nov 7, 2022
@ritave ritave changed the title Json superstruct struct can now be cast to Json type Json Params are now properly castable to Json type Nov 7, 2022
@ritave ritave changed the title Json Params are now properly castable to Json type Json RPC params are now properly castable to Json type Nov 7, 2022
Mrtenz pushed a commit that referenced this pull request Dec 2, 2022
* Cast JsonRPC to Json

JsonRpcStruct params was type Record<string, unknown> | unknown[], but
in other parts of the code we use Json to denote such structures.
unknown is not castable to Json because of undefined and classes.
This commit solves the compatibillity issue with other parts of the code

* PR review changes

* Nicer JSON validation msg

* Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants