PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/got/dist/source/core/utils
Просмотр файла: get-buffer.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// TODO: Update https://github.com/sindresorhus/get-stream
const getBuffer = async (stream) => {
const chunks = [];
let length = 0;
for await (const chunk of stream) {
chunks.push(chunk);
length += Buffer.byteLength(chunk);
}
if (Buffer.isBuffer(chunks[0])) {
return Buffer.concat(chunks, length);
}
return Buffer.from(chunks.join(''));
};
exports.default = getBuffer;
Выполнить команду
Для локальной разработки. Не используйте в интернете!