Files
Shifted/node_modules/@mswjs/interceptors/lib/browser/bufferUtils-Uc0eRItL.cjs.map
2026-02-10 01:14:19 +00:00

1 line
1.0 KiB
Plaintext

{"version":3,"file":"bufferUtils-Uc0eRItL.cjs","names":[],"sources":["../../src/utils/bufferUtils.ts"],"sourcesContent":["const encoder = new TextEncoder()\n\nexport function encodeBuffer(text: string): Uint8Array {\n return encoder.encode(text)\n}\n\nexport function decodeBuffer(buffer: ArrayBuffer, encoding?: string): string {\n const decoder = new TextDecoder(encoding)\n return decoder.decode(buffer)\n}\n\n/**\n * Create an `ArrayBuffer` from the given `Uint8Array`.\n * Takes the byte offset into account to produce the right buffer\n * in the case when the buffer is bigger than the data view.\n */\nexport function toArrayBuffer(array: Uint8Array): ArrayBuffer {\n return array.buffer.slice(\n array.byteOffset,\n array.byteOffset + array.byteLength\n )\n}\n"],"mappings":";;AAAA,MAAM,UAAU,IAAI,aAAa;AAEjC,SAAgB,aAAa,MAA0B;AACrD,QAAO,QAAQ,OAAO,KAAK;;AAG7B,SAAgB,aAAa,QAAqB,UAA2B;AAE3E,QADgB,IAAI,YAAY,SAAS,CAC1B,OAAO,OAAO;;;;;;;AAQ/B,SAAgB,cAAc,OAAgC;AAC5D,QAAO,MAAM,OAAO,MAClB,MAAM,YACN,MAAM,aAAa,MAAM,WAC1B"}