Created
August 13, 2025 08:16
-
-
Save gabri83/05d16c318ee0bde207a56985b62c06fe to your computer and use it in GitHub Desktop.
TypeScript: Type Guard Function
This file contains hidden or 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 isString(value: unknown): value is string { | |
| return typeof value === 'string'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment