/var/www/verywell.gr/server/delivery/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.ts28720644editdlrm
apitypes.js7090644editdlrm
apitypes.js.map1340644editdlrm
call.d.ts19570644editdlrm
call.js38850644editdlrm
call.js.map21100644editdlrm
clientInterface.d.ts17220644editdlrm
clientInterface.js9080644editdlrm
clientInterface.js.map3330644editdlrm
createApiCall.d.ts17620644editdlrm
createApiCall.js43520644editdlrm
createApiCall.js.map18110644editdlrm
descriptor.d.ts10730644editdlrm
descriptor.js15720644editdlrm
descriptor.js.map2850644editdlrm
fallback.d.ts65440644editdlrm
fallback.js136730644editdlrm
fallback.js.map62540644editdlrm
fallbackProto.d.ts9460644editdlrm
fallbackProto.js22660644editdlrm
fallbackProto.js.map14290644editdlrm
fallbackRest.d.ts9460644editdlrm
fallbackRest.js33550644editdlrm
fallbackRest.js.map21530644editdlrm
fallbackServiceStub.d.ts15750644editdlrm
fallbackServiceStub.js52570644editdlrm
fallbackServiceStub.js.map30370644editdlrm
featureDetection.d.ts8560644editdlrm
featureDetection.js21060644editdlrm
featureDetection.js.map9140644editdlrm
gax.d.ts149580644editdlrm
gax.js220900644editdlrm
gax.js.map82980644editdlrm
googleError.d.ts22110644editdlrm
googleError.js72160644editdlrm
googleError.js.map45040644editdlrm
grpc.d.ts89300644editdlrm
grpc.js206710644editdlrm
grpc.js.map114420644editdlrm
iamService.d.ts59610644editdlrm
iamService.js92520644editdlrm
iamService.js.map61000644editdlrm
iam_policy_service_client_config.json10630644editdlrm
index.d.ts31010644editdlrm
index.js66870644editdlrm
index.js.map16800644editdlrm
locationService.d.ts73820644editdlrm
locationService.js172800644editdlrm
locationService.js.map71540644editdlrm
locations_client_config.json9330644editdlrm
operationsClient.d.ts162660644editdlrm
operationsClient.js196990644editdlrm
operationsClient.js.map55660644editdlrm
operations_client_config.json12490644editdlrm
pathTemplate.d.ts19660644editdlrm
pathTemplate.js99330644editdlrm
pathTemplate.js.map65950644editdlrm
protosList.json49210644editdlrm
routingHeader.d.ts11240644editdlrm
routingHeader.js13170644editdlrm
routingHeader.js.map2830644editdlrm
status.d.ts11530644editdlrm
status.js32290644editdlrm
status.js.map15700644editdlrm
streamArrayParser.d.ts21450644editdlrm
streamArrayParser.js62120644editdlrm
streamArrayParser.js.map32620644editdlrm
transcoding.d.ts25920644editdlrm
transcoding.js120950644editdlrm
transcoding.js.map94670644editdlrm
util.d.ts9870644editdlrm
util.js19840644editdlrm
util.js.map10640644editdlrm
warnings.d.ts6820644editdlrm
warnings.js13760644editdlrm
warnings.js.map6290644editdlrm
Edit: /var/www/verywell.gr/server/delivery/node_modules/google-gax/build/src/streamArrayParser.js (6212B)
"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 = featureDetection_1.hasAbortController() ? // eslint-disable-next-line no-undef 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 = 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