Skip to content

Commit 6a7d367

Browse files
fix: reduce through2 usage (#711)
1 parent 765c4b7 commit 6a7d367

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

handwritten/bigtable/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"docs-test": "linkinator docs",
3434
"fix": "gts fix",
3535
"prelint": "cd samples; npm link ../; npm install",
36-
"lint": "gts fix",
36+
"lint": "gts check",
3737
"prepare": "npm run compile",
3838
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
3939
"snippet-test": "mocha samples/document-snippets/tests/*.js --timeout 600000",

handwritten/bigtable/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import arrify = require('arrify');
1818
import * as extend from 'extend';
1919
import {GoogleAuth, CallOptions} from 'google-gax';
2020
import * as gax from 'google-gax';
21-
import * as through from 'through2';
2221
import * as protos from '../protos/protos';
2322
import {AbortableDuplex} from '@google-cloud/common';
2423

@@ -36,6 +35,7 @@ import {shouldRetryRequest} from './decorateStatus';
3635
import {google} from '../protos/protos';
3736
import {ServiceError} from 'google-gax';
3837
import * as v2 from './v2';
38+
import {PassThrough} from 'stream';
3939

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

750750
if (isStreamMode) {
751-
stream = streamEvents(through.obj());
752-
751+
stream = streamEvents(new PassThrough({objectMode: true}));
753752
stream.abort = () => {
754753
if (gaxStream && gaxStream.cancel) {
755754
gaxStream.cancel();

handwritten/bigtable/system-test/mutate-rows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {PartialFailureError} from '@google-cloud/common/build/src/util';
2929
import {Entry} from '../src/table';
3030
import {CancellableStream, GrpcClient} from 'google-gax';
3131
import {BigtableClient} from '../src/v2';
32-
import { PassThrough } from 'stream';
32+
import {PassThrough} from 'stream';
3333

3434
const {grpc} = new GrpcClient();
3535

0 commit comments

Comments
 (0)