Skip to content

Instantly share code, notes, and snippets.

@umarov
Created April 18, 2019 18:47
Show Gist options
  • Save umarov/1811eae0f7a09bafedf3bf497380d32a to your computer and use it in GitHub Desktop.
Save umarov/1811eae0f7a09bafedf3bf497380d32a to your computer and use it in GitHub Desktop.
TypeScript hacks
function isDefined<T>(x: T | undefined): x is T {
return typeof x !== undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment