Skip to content

Instantly share code, notes, and snippets.

@TorbjornHoltmon
Created February 11, 2022 12:25
Show Gist options
  • Save TorbjornHoltmon/6321bd307035fdf11246692bf6883bf2 to your computer and use it in GitHub Desktop.
Save TorbjornHoltmon/6321bd307035fdf11246692bf6883bf2 to your computer and use it in GitHub Desktop.
Type predicates
export function assertIAsset<T>(item: IAsset | IReference): item is IAsset {
return item.type === "typenavn her";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment