Created
March 15, 2019 13:23
-
-
Save michaeljscript/9dcd7925eaa8894d6dc716d5176c21e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkType<T>(value: unknown, parse: (val: unknown) => T | null): value is T { | |
return parse(value) !== null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment