Skip to content

Commit

Permalink
chore(typescript): enable noImplicitAny (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Oct 24, 2018
1 parent 230a54d commit d50d25b
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 170 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"@types/async": "^2.0.49",
"@types/compressible": "^2.0.0",
"@types/concat-stream": "^1.6.0",
"@types/configstore": "^2.1.1",
"@types/extend": "^3.0.0",
"@types/mime": "^2.0.0",
"@types/mime-types": "^2.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export type GetBucketMetadataResponse = [Metadata, request.Response];
* @param {object} metadata The bucket metadata.
* @param {object} apiResponse The full API response.
*/
export interface GetBucketMetadataCallback extends GetMetadataCallback {
export interface GetBucketMetadataCallback {
(err: ApiError|null, metadata: Metadata|null,
apiResponse: request.Response): void;
}
Expand Down Expand Up @@ -610,7 +610,7 @@ export type UploadResponse = [File, request.Response];
* @param {object} apiResponse The full API response.
*/
export interface UploadCallback {
(err?: Error|null, file?: File|null, apiResponse?: request.Response): void;
(err: Error|null, file?: File|null, apiResponse?: request.Response): void;
}

/**
Expand Down Expand Up @@ -2909,9 +2909,9 @@ class Bucket extends ServiceObject {
* Example of uploading an encrypted file:
*/
upload(pathString: string, options?: UploadOptions): Promise<UploadResponse>;
upload(pathString: string, callback: UploadCallback): void;
upload(pathString: string, options: UploadOptions, callback: UploadCallback):
void;
upload(pathString: string, callback: UploadCallback): void;
upload(
pathString: string, optionsOrCallback?: UploadOptions|UploadCallback,
callback?: UploadCallback): Promise<UploadResponse>|void {
Expand Down
10 changes: 6 additions & 4 deletions src/iam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@ class Iam {

const availablePermissions = arrify(resp.permissions);

const permissionsHash = permissionsArray.reduce((acc, permission) => {
acc[permission] = availablePermissions.indexOf(permission) > -1;
return acc;
}, {});
const permissionsHash = permissionsArray.reduce(
(acc: {[index: string]: boolean}, permission) => {
acc[permission] = availablePermissions.indexOf(permission) > -1;
return acc;
},
{});

cb!(null, permissionsHash, resp);
});
Expand Down
Loading

0 comments on commit d50d25b

Please sign in to comment.