Skip to content

Instantly share code, notes, and snippets.

@leonardokl
Created June 1, 2020 14:08
Show Gist options
  • Save leonardokl/1ee2a8913a80f5665643d90c9e38c932 to your computer and use it in GitHub Desktop.
Save leonardokl/1ee2a8913a80f5665643d90c9e38c932 to your computer and use it in GitHub Desktop.
TypeScript
export function isDefined<TValue>(value: TValue | undefined): value is TValue {
return typeof value !== 'undefined';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment