pass-through-decoder.js 273 B

12345678910111213141516171819
  1. const b4a = require('b4a')
  2. module.exports = class PassThroughDecoder {
  3. constructor (encoding) {
  4. this.encoding = encoding
  5. }
  6. get remaining () {
  7. return 0
  8. }
  9. decode (tail) {
  10. return b4a.toString(tail, this.encoding)
  11. }
  12. flush () {
  13. return ''
  14. }
  15. }