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

Local type-check #16

Open
Kobzol opened this issue Aug 3, 2018 · 1 comment
Open

Local type-check #16

Kobzol opened this issue Aug 3, 2018 · 1 comment

Comments

@Kobzol
Copy link

Kobzol commented Aug 3, 2018

Is it possible to use this library to do local type checks? I don't want to type check my whole app at runtime (I trust TypeScript to do that at compile time), but I'd like to type check individual variables at certain places (mainly API boundaries). So for example this:

verify<MyType>(obj); // throws if obj doesn't conform to interface MyType

This is obviously supported by this tool, because it does it behind the scenes, but I wonder if this API is exposed?

@fabiandev
Copy link
Owner

Currently there is no such option to gradually opt-in for type checks, however this is something I was considering. If it happens that I can invest time again in this project, I will definitely keep this in mind.

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

No branches or pull requests

2 participants