message: refactor(ts): added ts style fix for src/publisher.ts
diff: * limitations under the License.
  */
  -import * as arrify from 'arrify';
  import {promisifyAll} from '@google-cloud/promisify';
  +import * as arrify from 'arrify';
  +
  const each = require('async-each');
  import * as extend from 'extend';
  import * as is from 'is';
  @@ -48,6 +49,7 @@ import { Topic } from './topic';
  * const publisher = topic.publisher();
  */
  export class Publisher {
  + // tslint:disable-next-line variable-name
  Promise?: PromiseConstructor;
  topic: Topic;
  inventory_;
  @@ -58,16 +60,14 @@ export class Publisher {
  this.Promise = topic.Promise;
  }
  options = extend(
  - true,
  - {
  + true, {
  batching: {
  maxBytes: Math.pow(1024, 2) * 5,
  maxMessages: 1000,
  maxMilliseconds: 100,
  },
  },
  - options
  - );
  + options);
  /**
  * The topic of this publisher.
  *
  @@ -157,20 +157,19 @@ export class Publisher {
  attributes = {};
  }
  // Ensure the `attributes` object only has string values
  - for (const key in attributes) {
  + for (const key of Object.keys(attributes)) {
  const value = attributes[key];
  if (!is.string(value)) {
  throw new TypeError(`All attributes must be in the form of a string.
  \nInvalid value of type "${typeof value}" provided for "${key}".`);
  }
  }
  +
  const opts = this.settings.batching;
  // if this message puts us over the maxBytes option, then let's ship
  // what we have and add it to the next batch
  - if (
  - this.inventory_.bytes > 0 &&
  - this.inventory_.bytes + data.length > opts.maxBytes
  - ) {
  + if (this.inventory_.bytes > 0 &&
  + this.inventory_.bytes + data.length > opts.maxBytes) {
  this.publish_();
  }
  // add it to the queue!
  @@ -184,10 +183,8 @@ export class Publisher {
  }
  // otherwise let's set a timeout to send the next batch
  if (!this.timeoutHandle_) {
  - this.timeoutHandle_ = setTimeout(
  - this.publish_.bind(this),
  - opts.maxMilliseconds
  - );
  + this.timeoutHandle_ =
  + setTimeout(this.publish_.bind(this), opts.maxMilliseconds);
  }
  }
  /**
  @@ -205,13 +202,13 @@ export class Publisher {
  this.timeoutHandle_ = null;
  const reqOpts = {
  topic: this.topic.name,
  - messages: messages,
  + messages,
  };
  this.topic.request(
  {
  client: 'PublisherClient',
  method: 'publish',
  - reqOpts: reqOpts,
  + reqOpts,
  gaxOpts: this.settings.gaxOpts,
  },
  (err, resp) => {
  @@ -221,8 +218,7 @@ export class Publisher {
  callback(err, messageId);
  next();
  });
  - }
  - );
  + });
  }
  /**
  * Queues message to be sent to the server.
  @@ -235,7 +231,7 @@ export class Publisher {
  */
  queue_(data, attrs, callback) {
  this.inventory_.queued.push({
  - data: data,
  + data,
  attributes: attrs,
  });
  this.inventory_.bytes += data.length;
  