Skip to content

Commit

Permalink
Merge branch 'main' into release-please--branches--main--components--…
Browse files Browse the repository at this point in the history
…google-gax
  • Loading branch information
sofisl authored May 17, 2023
2 parents 3fe3ffa + 111133c commit e7fbc8e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"@types/long": "^4.0.0",
"abort-controller": "^3.0.0",
"duplexify": "^4.0.0",
"fast-text-encoding": "^1.0.3",
"google-auth-library": "^8.0.2",
"is-stream-ended": "^0.1.4",
"node-fetch": "^2.6.1",
"object-hash": "^3.0.0",
"proto3-json-serializer": "^1.0.0",
Expand Down
5 changes: 0 additions & 5 deletions src/fallbackRest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@
import * as serializer from 'proto3-json-serializer';
import {defaultToObjectOptions} from './fallback';
import {FetchParameters, FetchParametersMethod} from './fallbackServiceStub';
import {hasTextDecoder, hasTextEncoder} from './featureDetection';
import {GoogleError} from './googleError';
import {transcode} from './transcoding';

if (!hasTextEncoder() || !hasTextDecoder()) {
require('fast-text-encoding');
}

export function encodeRequest(
rpc: protobuf.Method,
protocol: string,
Expand Down
8 changes: 0 additions & 8 deletions src/featureDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ export function hasWindowFetch() {
return features.windowFetch;
}

export function hasTextEncoder() {
return features.textEncoder;
}

export function hasTextDecoder() {
return features.textDecoder;
}

export function isNodeJS() {
return features.nodeJS;
}
Expand Down
5 changes: 2 additions & 3 deletions src/paginationCalls/pageDescriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import * as ended from 'is-stream-ended';
import {PassThrough, Transform} from 'stream';

import {APICaller} from '../apiCaller';
Expand Down Expand Up @@ -82,7 +81,7 @@ export class PageDescriptor implements Descriptor {
// emit full api response with every page.
stream.emit('response', apiResp);
for (let i = 0; i < resources.length; ++i) {
if (ended(stream)) {
if ((stream as any)._readableState.ended) {
return;
}
if (resources[i] === null) {
Expand All @@ -94,7 +93,7 @@ export class PageDescriptor implements Descriptor {
stream.end();
}
}
if (ended(stream)) {
if ((stream as any)._readableState.ended) {
return;
}
if (!next) {
Expand Down

0 comments on commit e7fbc8e

Please sign in to comment.