Created
March 28, 2021 14:39
-
-
Save uladkasach/073420e0547f5a0206ed6a6d2d532d60 to your computer and use it in GitHub Desktop.
isPresent.ts
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
// https://github.com/microsoft/TypeScript/issues/16069#issuecomment-566222173 | |
export const isPresent = <T>(t: T | undefined | null | void): t is T => t !== undefined && t !== null; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment