-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refactor(ts): enable noImplicitAny on cluster.ts #452
refactor(ts): enable noImplicitAny on cluster.ts #452
Conversation
export interface GenericCallback<T> { | ||
(err?: ServiceError|null, apiResponse?: T|null): void; | ||
} | ||
export interface GenericClusterCallback<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is necessary - I'm thinking that if these callbacks are only used once then a Generic isn't needed. Same in the cases where there are multiple callbacks with the same apiResponse. Let me know what you think!
Codecov Report
@@ Coverage Diff @@
## master #452 +/- ##
==========================================
- Coverage 95.57% 95.38% -0.19%
==========================================
Files 14 14
Lines 1468 1473 +5
Branches 84 102 +18
==========================================
+ Hits 1403 1405 +2
Misses 61 61
- Partials 4 7 +3
Continue to review full report at Codecov.
|
static getStorageType_(type) { | ||
const storageTypes = { | ||
static getStorageType_(type: string): number { | ||
const storageTypes: {[k: string]: number} = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I make a general-use interface for {[k: string]: number}
?
const callback = | ||
typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; | ||
const gaxOptions = | ||
typeof gaxOptionsOrCallback === 'object' && gaxOptionsOrCallback ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add && gaxOptionsOrCallback
to filter for null
- I'm thinking it's nice to have but I'd understand it not being necessary
|
||
this.getMetadata(gaxOptions, err => { | ||
this.getMetadata(gaxOptions, (err?: ServiceError|null) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.getMetadata()
callback param types not inferred :/
callback(err, err ? null : this, metadata); | ||
}); | ||
this.getMetadata( | ||
gaxOptions, (err?: ServiceError|null, metadata?: ICluster|null) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of ICluster
and other respective I<class name>
interfaces as metadata - is this the correct way to think about it?
Did my submission just get merged without change requests?? I want to thank my mom, my dog, Obama, and @callmehiphop for this honor 😭 |
Fixes #427 (4/21ish)
🤞
OPR 1 (4/4 @ 6:30pm): Initial draft submit