the-forest/client/node_modules/.cache/babel-loader/605f2254c3f639037dec75966bae4f705a9b8531f4680c8a6d8956485417cb71.json
2024-09-17 20:35:18 -04:00

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,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