Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit ecb81fa

Browse files
renovate[bot]JustinBeckwith
authored andcommitted
fix(deps): update dependency @google-cloud/common to ^0.27.0 (googleapis#525)
1 parent 24761c4 commit ecb81fa

7 files changed

Lines changed: 21 additions & 30 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
]
5454
},
5555
"dependencies": {
56-
"@google-cloud/common": "^0.26.0",
56+
"@google-cloud/common": "^0.27.0",
5757
"@google-cloud/paginator": "^0.1.0",
5858
"@google-cloud/promisify": "^0.3.0",
5959
"arrify": "^1.0.0",

src/bucket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export type GetBucketResponse = [Bucket, request.Response];
381381
* @param {Bucket} bucket The {@link Bucket}.
382382
* @param {object} apiResponse The full API response.
383383
*/
384-
export interface GetBucketCallback extends InstanceResponseCallback {
384+
export interface GetBucketCallback {
385385
(err: ApiError|null, bucket: Bucket|null,
386386
apiResponse: request.Response): void;
387387
}

src/file.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ class File extends ServiceObject {
875875
options = extend(true, {}, options);
876876
callback = callback || util.noop;
877877

878-
let destBucket: Bucket|File;
878+
let destBucket: Bucket;
879879
let destName: string;
880880
let newFile: File;
881881

@@ -888,8 +888,7 @@ class File extends ServiceObject {
888888
destBucket = this.bucket;
889889
destName = destination;
890890
}
891-
} else if (
892-
destination.constructor && destination.constructor.name === 'Bucket') {
891+
} else if (destination instanceof Bucket) {
893892
destBucket = destination;
894893
destName = this.name;
895894
} else if (destination instanceof File) {

system-test/.eslintrc.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

system-test/storage.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ describe('storage', () => {
407407
});
408408

409409
it('should not expose default api', () => {
410-
assert.strictEqual(typeof file.default, 'undefined');
410+
// tslint:disable-next-line no-any
411+
assert.strictEqual(typeof (file as any).default, 'undefined');
411412
});
412413

413414
it('should grant an account access', done => {
@@ -2379,9 +2380,9 @@ describe('storage', () => {
23792380
location: 'ASIA-EAST1',
23802381
dra: true,
23812382
},
2382-
cb as InstanceResponseCallback);
2383+
cb);
23832384
},
2384-
cb => file.copy(copiedFile, cb as InstanceResponseCallback)
2385+
cb => file.copy(copiedFile, cb as CopyCallback)
23852386
],
23862387
err => {
23872388
assert.ifError(err);

test/.eslintrc.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/bucket.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,27 @@ const snakeize = require('snakeize');
2626
import * as stream from 'stream';
2727
import * as through from 'through2';
2828
import {Bucket, Channel, Notification} from '../src';
29-
import {CreateWriteStreamOptions, File, SetFileMetadataOptions} from '../src/file';
29+
import {CreateWriteStreamOptions, File, SetFileMetadataOptions, FileOptions} from '../src/file';
3030
import {PromisifyAllOptions} from '@google-cloud/promisify';
3131
import * as r from 'request';
3232
import {GetBucketMetadataCallback, GetFilesOptions, MakeAllFilesPublicPrivateOptions, SetBucketMetadataCallback} from '../src/bucket';
3333
import {AddAclOptions} from '../src/acl';
3434

35+
36+
3537
class FakeFile {
3638
calledWith_: IArguments;
3739
bucket: Bucket;
3840
name: string;
39-
options?: {};
41+
options: FileOptions;
4042
metadata: {};
4143
createWriteStream: Function;
42-
isSameFile?: () => boolean;
43-
constructor(bucket: Bucket, name: string, options?: {}) {
44+
isSameFile = () => false;
45+
constructor(bucket: Bucket, name: string, options?: FileOptions) {
4446
this.calledWith_ = arguments;
4547
this.bucket = bucket;
4648
this.name = name;
47-
this.options = options;
49+
this.options = options || {};
4850
this.metadata = {};
4951

5052
this.createWriteStream = (options: CreateWriteStreamOptions) => {
@@ -1226,7 +1228,7 @@ describe('Bucket', () => {
12261228

12271229
describe('file', () => {
12281230
const FILE_NAME = 'remote-file-name.jpg';
1229-
let file: File;
1231+
let file: FakeFile;
12301232
const options = {a: 'b', c: 'd'};
12311233

12321234
beforeEach(() => {
@@ -2242,7 +2244,7 @@ describe('Bucket', () => {
22422244
encryptionKey: 'key',
22432245
kmsKeyName: 'kms-key-name',
22442246
};
2245-
bucket.upload(filepath, options, (err: Error, file: File) => {
2247+
bucket.upload(filepath, options, (err: Error, file: FakeFile) => {
22462248
assert.ifError(err);
22472249
assert.strictEqual(file.bucket.name, bucket.name);
22482250
assert.deepStrictEqual(file.metadata, metadata);
@@ -2259,7 +2261,7 @@ describe('Bucket', () => {
22592261
encryptionKey: 'key',
22602262
kmsKeyName: 'kms-key-name',
22612263
};
2262-
bucket.upload(filepath, options, (err: Error, file: File) => {
2264+
bucket.upload(filepath, options, (err: Error, file: FakeFile) => {
22632265
assert.ifError(err);
22642266
assert.strictEqual(file.bucket.name, bucket.name);
22652267
assert.strictEqual(file.name, newFileName);
@@ -2277,7 +2279,7 @@ describe('Bucket', () => {
22772279
encryptionKey: 'key',
22782280
kmsKeyName: 'kms-key-name',
22792281
};
2280-
bucket.upload(filepath, options, (err: Error, file: File) => {
2282+
bucket.upload(filepath, options, (err: Error, file: FakeFile) => {
22812283
assert.ifError(err);
22822284
assert.strictEqual(file.bucket.name, bucket.name);
22832285
assert.strictEqual(file.name, newFileName);
@@ -2294,7 +2296,7 @@ describe('Bucket', () => {
22942296
return true;
22952297
};
22962298
const options = {destination: fakeFile};
2297-
bucket.upload(filepath, options, (err: Error, file: File) => {
2299+
bucket.upload(filepath, options, (err: Error, file: FakeFile) => {
22982300
assert.ifError(err);
22992301
assert(file.isSameFile());
23002302
done();
@@ -2307,7 +2309,7 @@ describe('Bucket', () => {
23072309
return true;
23082310
};
23092311
const options = {destination: fakeFile, metadata};
2310-
bucket.upload(filepath, options, (err: Error, file: File) => {
2312+
bucket.upload(filepath, options, (err: Error, file: FakeFile) => {
23112313
assert.ifError(err);
23122314
assert(file.isSameFile());
23132315
assert.deepStrictEqual(file.metadata, metadata);

0 commit comments

Comments
 (0)