1 line
5.3 KiB
JSON
1 line
5.3 KiB
JSON
|
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ByteQueue = void 0;\nclass ByteQueue {\n #array;\n #shiftPos;\n #pushPos;\n constructor(initialCap) {\n this.#array = new Uint8Array(new ArrayBuffer(initialCap));\n this.#shiftPos = 0;\n this.#pushPos = 0;\n }\n get length() {\n return this.#pushPos - this.#shiftPos;\n }\n data() {\n return this.#array.slice(this.#shiftPos, this.#pushPos);\n }\n push(chunk) {\n this.#ensurePush(chunk.byteLength);\n this.#array.set(chunk, this.#pushPos);\n this.#pushPos += chunk.byteLength;\n }\n #ensurePush(pushLength) {\n if (this.#pushPos + pushLength <= this.#array.byteLength) {\n return;\n }\n const filledLength = this.#pushPos - this.#shiftPos;\n if (filledLength + pushLength <= this.#array.byteLength && 2 * this.#pushPos >= this.#array.byteLength) {\n this.#array.copyWithin(0, this.#shiftPos, this.#pushPos);\n } else {\n let newCap = this.#array.byteLength;\n do {\n newCap *= 2;\n } while (filledLength + pushLength > newCap);\n const newArray = new Uint8Array(new ArrayBuffer(newCap));\n newArray.set(this.#array.slice(this.#shiftPos, this.#pushPos), 0);\n this.#array = newArray;\n }\n this.#pushPos = filledLength;\n this.#shiftPos = 0;\n }\n shift(length) {\n this.#shiftPos += length;\n }\n}\nexports.ByteQueue = ByteQueue;","map":{"version":3,"names":["Object","defineProperty","exports","value","ByteQueue","array","shiftPos","pushPos","constructor","initialCap","Uint8Array","ArrayBuffer","length","data","slice","push","chunk","ensurePush","byteLength","set","#ensurePush","pushLength","filledLength","copyWithin","newCap","newArray","shift"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-cjs/byte_queue.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ByteQueue = void 0;\nclass ByteQueue {\n #array;\n #shiftPos;\n #pushPos;\n constructor(initialCap) {\n this.#array = new Uint8Array(new ArrayBuffer(initialCap));\n this.#shiftPos = 0;\n this.#pushPos = 0;\n }\n get length() {\n return this.#pushPos - this.#shiftPos;\n }\n data() {\n return this.#array.slice(this.#shiftPos, this.#pushPos);\n }\n push(chunk) {\n this.#ensurePush(chunk.byteLength);\n this.#array.set(chunk, this.#pushPos);\n this.#pushPos += chunk.byteLength;\n }\n #ensurePush(pushLength) {\n if (this.#pushPos + pushLength <= this.#array.byteLength) {\n return;\n }\n const filledLength = this.#pushPos - this.#shiftPos;\n if (filledLength + pushLength <= this.#array.byteLength &&\n 2 * this.#pushPos >= this.#array.byteLength) {\n this.#array.copyWithin(0, this.#shiftPos, this.#pushPos);\n }\n else {\n let newCap = this.#array.byteLength;\n do {\n newCap *= 2;\n } while (filledLength + pushLength > newCap);\n const newArray = new Uint8Array(new ArrayBuffer(newCap));\n newArray.set(this.#array.slice(this.#shiftPos, this.#pushPos), 0);\n this.#array = newArray;\n }\n this.#pushPos = filledLength;\n this.#shiftPos = 0;\n }\n shift(length) {\n this.#shiftPos += length;\n }\n}\nexports.ByteQueue = ByteQueue;\n"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,SAAS,GAAG,KAAK,CAAC;AAC1B,MAAMA,SAAS,CAAC;EACZ,CAACC,KAAK;EACN,CAACC,QAAQ;EACT,CAACC,OAAO;EACRC,WAAWA,CAACC,UAAU,EAAE;IACpB,IAAI,CAAC,CAACJ,KAAK,GAAG,IAAIK,UAAU,CAAC,IAAIC,WAAW,CAACF,UAAU,CAAC,CAAC;IACzD,IAAI,CAAC,CAACH,QAAQ,GAAG,CAAC;IAClB,IAAI,CAAC,CAACC,OAAO,GAAG,CAAC;EACrB;EACA,IAAIK,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAAC,CAACL,OAAO,GAAG,IAAI,CAAC,CAACD,QAAQ;EACzC;EACAO,IAAIA,CAAA,EAAG;IACH,OAAO,IAAI,CAAC,CAACR,KAAK,CAACS,KAAK,CAAC,IAAI,CAAC,CAACR
|