/var/www/greso.tech/server/nsm/node_modules/google-gax/build/src
NameSizeModeActions
bundlingCalls/-0755rm
longRunningCalls/-0755rm
normalCalls/-0755rm
paginationCalls/-0755rm
streamingCalls/-0755rm
apiCaller.d.ts17460644editdlrm
apiCaller.js10370644editdlrm
apiCaller.js.map3220644editdlrm
apitypes.d.ts27900644editdlrm
apitypes.js7090644editdlrm
apitypes.js.map1340644editdlrm
call.d.ts19570644editdlrm
call.js38850644editdlrm
call.js.map21100644editdlrm
clientInterface.d.ts17520644editdlrm
clientInterface.js9080644editdlrm
clientInterface.js.map3330644editdlrm
createApiCall.d.ts18020644editdlrm
createApiCall.js44980644editdlrm
createApiCall.js.map18740644editdlrm
descriptor.d.ts10730644editdlrm
descriptor.js16910644editdlrm
descriptor.js.map2860644editdlrm
fallback.d.ts77610644editdlrm
fallback.js169910644editdlrm
fallback.js.map71960644editdlrm
fallbackProto.d.ts9460644editdlrm
fallbackProto.js22660644editdlrm
fallbackProto.js.map14290644editdlrm
fallbackRest.d.ts9690644editdlrm
fallbackRest.js33530644editdlrm
fallbackRest.js.map21390644editdlrm
fallbackServiceStub.d.ts16830644editdlrm
fallbackServiceStub.js63260644editdlrm
fallbackServiceStub.js.map36630644editdlrm
featureDetection.d.ts8560644editdlrm
featureDetection.js21140644editdlrm
featureDetection.js.map9240644editdlrm
gax.d.ts150500644editdlrm
gax.js225200644editdlrm
gax.js.map83600644editdlrm
googleError.d.ts24260644editdlrm
googleError.js98850644editdlrm
googleError.js.map60230644editdlrm
grpc.d.ts90250644editdlrm
grpc.js206320644editdlrm
grpc.js.map114160644editdlrm
iamService.d.ts59540644editdlrm
iamService.js90530644editdlrm
iamService.js.map59480644editdlrm
iam_policy_service_client_config.json10630644editdlrm
index.d.ts31010644editdlrm
index.js74500644editdlrm
index.js.map16800644editdlrm
locationService.d.ts74100644editdlrm
locationService.js170790644editdlrm
locationService.js.map70410644editdlrm
locations_client_config.json9330644editdlrm
operationsClient.d.ts163130644editdlrm
operationsClient.js199830644editdlrm
operationsClient.js.map57430644editdlrm
operations_client_config.json12490644editdlrm
pathTemplate.d.ts19660644editdlrm
pathTemplate.js99330644editdlrm
pathTemplate.js.map65950644editdlrm
protobuf.d.ts6510644editdlrm
protobuf.js10370644editdlrm
protobuf.js.map2070644editdlrm
protosList.json49210644editdlrm
routingHeader.d.ts11240644editdlrm
routingHeader.js13170644editdlrm
routingHeader.js.map2830644editdlrm
status.d.ts11530644editdlrm
status.js32290644editdlrm
status.js.map15700644editdlrm
streamArrayParser.d.ts22730644editdlrm
streamArrayParser.js61690644editdlrm
streamArrayParser.js.map32590644editdlrm
transcoding.d.ts23710644editdlrm
transcoding.js108770644editdlrm
transcoding.js.map86740644editdlrm
util.d.ts12540644editdlrm
util.js34730644editdlrm
util.js.map23590644editdlrm
warnings.d.ts6820644editdlrm
warnings.js13810644editdlrm
warnings.js.map6340644editdlrm
Edit: /var/www/greso.tech/server/nsm/node_modules/google-gax/build/src/streamArrayParser.js (6169B)
"use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.StreamArrayParser = void 0; const abort_controller_1 = require("abort-controller"); const stream_1 = require("stream"); const fallbackRest_1 = require("./fallbackRest"); const featureDetection_1 = require("./featureDetection"); class StreamArrayParser extends stream_1.Transform { /** * StreamArrayParser processes array of valid JSON objects in random chunks * through readable stream, and produces a stream of plain Javascript objects * where it converted from the corresponding protobuf message instance. * * The default JSON parser decodes the input stream under the * following rules: * 1. The stream represents a valid JSON array (must start with a "[" and * close with the corresponding "]"). Each element of this array is assumed to * be either an array or an object, and will be decoded as a JS object and * delivered. * 2. All JSON elements in the buffer will be decoded and delivered in a * stream. * * @private * @constructor * @param {protobuf.Method} rpc - the protobuf method produce array of JSON. * @param {Object} options - the options pass to Transform Stream. See more * details * https://nodejs.org/api/stream.html#stream_new_stream_transform_options. */ constructor(rpc, options) { super(Object.assign({}, options, { readableObjectMode: true })); this._done = false; this._prevBlock = Buffer.from(''); this._isInString = false; this._isSkipped = false; this._level = 0; this.rpc = rpc; this.cancelController = (0, featureDetection_1.hasAbortController)() ? new AbortController() : new abort_controller_1.AbortController(); this.cancelSignal = this.cancelController.signal; this.cancelRequested = false; } _transform(chunk, _, callback) { let objectStart = 0; let curIndex = 0; if (this._level === 0 && curIndex === 0) { if (String.fromCharCode(chunk[0]) !== '[') { this.emit('error', new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(chunk[0])}`)); } curIndex++; this._level++; } while (curIndex < chunk.length) { const curValue = String.fromCharCode(chunk[curIndex]); if (!this._isSkipped) { switch (curValue) { case '{': // Check if it's in string, we ignore the curly brace in string. // Otherwise the object level++. if (!this._isInString) { this._level++; } if (!this._isInString && this._level === 2) { objectStart = curIndex; } break; case '"': // Flip the string status this._isInString = !this._isInString; break; case '}': // check if it's in string // if true, do nothing // if false and level = 0, push data if (!this._isInString) { this._level--; } if (!this._isInString && this._level === 1) { // find a object const objBuff = Buffer.concat([ this._prevBlock, chunk.slice(objectStart, curIndex + 1), ]); try { // HTTP reponse.ok is true. const msgObj = (0, fallbackRest_1.decodeResponse)(this.rpc, true, objBuff); this.push(msgObj); } catch (err) { this.emit('error', err); } objectStart = curIndex + 1; this._prevBlock = Buffer.from(''); } break; case ']': if (!this._isInString && this._level === 1) { this._done = true; this.push(null); } break; case '\\': // Escaping escape character. this._isSkipped = true; break; default: break; } } else { this._isSkipped = false; } curIndex++; } if (this._level > 1) { this._prevBlock = Buffer.concat([ this._prevBlock, chunk.slice(objectStart, curIndex), ]); } callback(); } _flush(callback) { callback(); } cancel() { this._done = true; this.cancelRequested = true; this.cancelController.abort(); this.end(); } } exports.StreamArrayParser = StreamArrayParser; //# sourceMappingURL=streamArrayParser.js.map