版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 1 година
123456789101112131415
  1. /*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  2. module.exports = function (stream, cb) {
  3. var chunks = []
  4. stream.on('data', function (chunk) {
  5. chunks.push(chunk)
  6. })
  7. stream.once('end', function () {
  8. if (cb) cb(null, Buffer.concat(chunks))
  9. cb = null
  10. })
  11. stream.once('error', function (err) {
  12. if (cb) cb(err)
  13. cb = null
  14. })
  15. }