We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I read this blogpost by @ddprrt that offered a solution to making a custom hasOwnProperty that returns a type predicate:
hasOwnProperty
function hasOwnProperty<X extends {}, Y extends PropertyKey> (obj: X, prop: Y): obj is X & Record<Y, unknown> { return obj.hasOwnProperty(prop) }
The type will diverge from TypeScript's native hasOwnProperty type, but what do you think of this enhancement?
The text was updated successfully, but these errors were encountered:
👍 PR welcome.
Sorry, something went wrong.
objectHasOwn
Cool! 👏
Successfully merging a pull request may close this issue.
I read this blogpost by @ddprrt that offered a solution to making a custom
hasOwnProperty
that returns a type predicate:The type will diverge from TypeScript's native
hasOwnProperty
type, but what do you think of this enhancement?The text was updated successfully, but these errors were encountered: