mirror of
https://github.com/github/codeql-action.git
synced 2025-12-30 19:20:08 +08:00
22 lines
480 B
JavaScript
22 lines
480 B
JavaScript
// src/utils/bufferUtils.ts
|
|
var encoder = new TextEncoder();
|
|
function encodeBuffer(text) {
|
|
return encoder.encode(text);
|
|
}
|
|
function decodeBuffer(buffer, encoding) {
|
|
const decoder = new TextDecoder(encoding);
|
|
return decoder.decode(buffer);
|
|
}
|
|
function toArrayBuffer(array) {
|
|
return array.buffer.slice(
|
|
array.byteOffset,
|
|
array.byteOffset + array.byteLength
|
|
);
|
|
}
|
|
|
|
export {
|
|
encodeBuffer,
|
|
decodeBuffer,
|
|
toArrayBuffer
|
|
};
|
|
//# sourceMappingURL=chunk-6HYIRFX2.mjs.map
|