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

[ts-sdk] generate TS type guards (replace superstruct) #1509

Merged
merged 17 commits into from
Apr 21, 2022
Merged

Conversation

stella3d
Copy link
Contributor

created this branch to show another approach that allows eliminating the superstruct boilerplate and keeping standard TS definitions. This works better with Intellisense, eliminates the dual type declarations, allows us to embed just the guard functions instead of the superstruct lib.

This approach auto-generates type guards for the project at build time.

@stella3d stella3d requested review from damirka and 666lcz April 21, 2022 08:41
@stella3d stella3d self-assigned this Apr 21, 2022
@666lcz
Copy link
Contributor

666lcz commented Apr 21, 2022

Love this! Did not know that there's a type guard generator. This seems to be an overall better solution than superstruct. The only downside is with superstruct is easier to debug which field is wrong while type guard only gives you a boolean.

@stella3d
Copy link
Contributor Author

updated to add license headers to generated files

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