Skip to content

Instantly share code, notes, and snippets.

@mtimbs
Last active September 14, 2020 07:28
Show Gist options
  • Save mtimbs/2ae3908979450ded84c67d6d4a5bad6e to your computer and use it in GitHub Desktop.
Save mtimbs/2ae3908979450ded84c67d6d4a5bad6e to your computer and use it in GitHub Desktop.
function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown> {
return Object.hasOwnProperty.call(obj, prop)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment