Skip to content

Commit

Permalink
fix: reduce through2 usage (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Apr 17, 2020
1 parent 4125e06 commit dd84765
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -33,7 +33,7 @@
"docs-test": "linkinator docs",
"fix": "gts fix",
"prelint": "cd samples; npm link ../; npm install",
"lint": "gts fix",
"lint": "gts check",
"prepare": "npm run compile",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"snippet-test": "mocha samples/document-snippets/tests/*.js --timeout 600000",
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Expand Up @@ -18,7 +18,6 @@ import arrify = require('arrify');
import * as extend from 'extend';
import {GoogleAuth, CallOptions} from 'google-gax';
import * as gax from 'google-gax';
import * as through from 'through2';
import * as protos from '../protos/protos';
import {AbortableDuplex} from '@google-cloud/common';

Expand All @@ -36,6 +35,7 @@ import {shouldRetryRequest} from './decorateStatus';
import {google} from '../protos/protos';
import {ServiceError} from 'google-gax';
import * as v2 from './v2';
import {PassThrough} from 'stream';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const retryRequest = require('retry-request');
Expand Down Expand Up @@ -748,8 +748,7 @@ export class Bigtable {
};

if (isStreamMode) {
stream = streamEvents(through.obj());

stream = streamEvents(new PassThrough({objectMode: true}));
stream.abort = () => {
if (gaxStream && gaxStream.cancel) {
gaxStream.cancel();
Expand Down
2 changes: 1 addition & 1 deletion system-test/mutate-rows.ts
Expand Up @@ -29,7 +29,7 @@ import {PartialFailureError} from '@google-cloud/common/build/src/util';
import {Entry} from '../src/table';
import {CancellableStream, GrpcClient} from 'google-gax';
import {BigtableClient} from '../src/v2';
import { PassThrough } from 'stream';
import {PassThrough} from 'stream';

const {grpc} = new GrpcClient();

Expand Down

0 comments on commit dd84765

Please sign in to comment.