Skip to content

Commit

Permalink
chore(deps): update dependency typescript to ~3.2.0 (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and JustinBeckwith committed Dec 2, 2018
1 parent 4b5c854 commit bd237dc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"proxyquire": "^2.0.0",
"sinon": "^7.1.1",
"source-map-support": "^0.5.9",
"typescript": "~3.1.5"
"typescript": "~3.2.0"
},
"nyc": {
"exclude": [
Expand Down
6 changes: 2 additions & 4 deletions src/iam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
import {promisifyAll} from '@google-cloud/promisify';
import * as arrify from 'arrify';
import {CallOptions} from 'google-gax';
import * as is from 'is';
import * as r from 'request';
import {PubSub} from '.';


/**
* @callback GetPolicyCallback
* @param {?Error} err Request error, if any.
Expand Down Expand Up @@ -175,7 +172,8 @@ export class IAM {
this.Promise = pubsub.Promise;
}
this.pubsub = pubsub;
this.request = pubsub.request.bind(pubsub);
// tslint:disable-next-line no-any
this.request = pubsub.request.bind(pubsub) as any;
this.id = id;
}

Expand Down
3 changes: 2 additions & 1 deletion src/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ export class Subscriber extends EventEmitter {
deadline =>
this.modifyAckDeadline_(modAcks[deadline], Number(deadline)));

requests.push.apply(requests, modAckRequests);
// tslint:disable-next-line no-any
requests.push.apply(requests, modAckRequests as any);

Promise.all(modAckRequests).then(() => {
this.inventory_.nack = [];
Expand Down
3 changes: 2 additions & 1 deletion src/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export class Topic {
* @type {PubSub}
*/
this.parent = this.pubsub = pubsub;
this.request = pubsub.request.bind(pubsub);
// tslint:disable-next-line no-any
this.request = pubsub.request.bind(pubsub) as any;
/**
* [IAM (Identity and Access
* Management)](https://cloud.google.com/pubsub/access_control) allows you
Expand Down
4 changes: 2 additions & 2 deletions test/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class FakeConnectionPool extends EventEmitter {
calledWith_: IArguments;
constructor() {
super();
this.calledWith_ = [].slice.call(arguments);
this.calledWith_ = arguments;
}
}

class FakeHistogram {
calledWith_: IArguments;
constructor() {
this.calledWith_ = [].slice.call(arguments);
this.calledWith_ = arguments;
}
}
// tslint:disable-next-line no-any
Expand Down
9 changes: 3 additions & 6 deletions test/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ const fakePromisify = Object.assign({}, pfy, {
class FakeIAM {
calledWith_: IArguments;
constructor() {
this.calledWith_ = [].slice.call(arguments);
this.calledWith_ = arguments;
}
}

class FakeSnapshot {
calledWith_: IArguments;
static formatName_?: Function;
constructor() {
this.calledWith_ = [].slice.call(arguments);
this.calledWith_ = arguments;
}
}

class FakeSubscriber {
calledWith_: IArguments;
constructor() {
this.calledWith_ = [].slice.call(arguments);
this.calledWith_ = arguments;
}
}

Expand Down Expand Up @@ -149,17 +149,14 @@ describe('Subscription', () => {

it('should create an IAM object', () => {
assert(subscription.iam instanceof FakeIAM);

const args = subscription.iam.calledWith_;

assert.strictEqual(args[0], PUBSUB);
assert.strictEqual(args[1], subscription.name);
});

it('should inherit from Subscriber', () => {
const options = {};
const subscription = new Subscription(PUBSUB, SUB_NAME, options);

assert(subscription instanceof FakeSubscriber);
assert.strictEqual(subscription.calledWith_[0], options);
});
Expand Down
16 changes: 10 additions & 6 deletions test/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ const fakePromisify = Object.assign({}, pfy, {
});

class FakeIAM {
calledWith_: IArguments;
constructor() {
this.calledWith_ = [].slice.call(arguments);
// tslint:disable-next-line no-any
calledWith_: any[];
// tslint:disable-next-line no-any
constructor(...args: any[]) {
this.calledWith_ = args;
}
}

class FakePublisher {
calledWith_: IArguments;
constructor() {
this.calledWith_ = [].slice.call(arguments);
// tslint:disable-next-line no-any
calledWith_: any[];
// tslint:disable-next-line no-any
constructor(...args: any[]) {
this.calledWith_ = args;
}
}

Expand Down

0 comments on commit bd237dc

Please sign in to comment.