the-forest/client/node_modules/.cache/babel-loader/f83e6246becd90ca94a6fbbe1969a35e9c8f2b248dd18b20a59a09fd398cc86b.json

1 line
4.9 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"ast":null,"code":"export class 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}","map":{"version":3,"names":["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-esm/byte_queue.js"],"sourcesContent":["export class 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}\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,CAAC;EACnB,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,QAAQ,EAAE,IAAI,CAAC,CAACC,OAAO,CAAC;EAC3D;EACAQ,IAAIA,CAACC,KAAK,EAAE;IACR,IAAI,CAAC,CAACC,UAAU,CAACD,KAAK,CAACE,UAAU,CAAC;IAClC,IAAI,CAAC,CAACb,KAAK,CAACc,GAAG,CAACH,KAAK,EAAE,IAAI,CAAC,CAACT,OAAO,CAAC;IACrC,IAAI,CAAC,CAACA,OAAO,IAAIS,KAAK,CAACE,UAAU;EACrC;EACA,CAACD,UAAUG,CAACC,UAAU,EAAE;IACpB,IAAI,IAAI,CAAC,CAACd,OAAO,GAAGc,UAAU,IAAI,IAAI,CAAC,CAAChB,KAAK,CAACa,UAAU,EAAE;MACtD;IACJ;IACA,MAAMI,YAAY,GAAG,IAAI,CAAC,CAACf,OAAO,GAAG,IAAI,CAAC,C