-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
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
Set a type guard for hasOwnProperty signature. #18282
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Suggestion
An idea for TypeScript
Comments
you do not need the hasOwnProperty<T>(this: T, v: PropertyKey): v is keyof T; |
The use of |
mhegazy
added
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
and removed
Help Wanted
You can do this
labels
Sep 6, 2017
similar discussion can be found in #12253 (comment) |
mhegazy
added
the
Declined
The issue was declined as something which matches the TypeScript vision
label
Sep 6, 2017
This really isn't appropriate. At runtime, your object might have more keys than There are two things that this function gives information about:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Suggestion
An idea for TypeScript
TypeScript Version: 2.5.0-dev.20170629
Watch this code with a new version of hasOwnProperty:
Suggestion:
Change the actual declaration of
hasOwnProperty
:With a new one type guarded:
Something that also could be added is a type guard to
in
operator to work as the type guard of the suggestedhasOwnProperty
.The text was updated successfully, but these errors were encountered: