src/decode.js
function next () {
      let doNext = true
      let decoded = false

      const decodeCb = (err, msg) => {
        decoded = true
        if (err) {
          p.end(err)
          doNext = false
        } else {
          p.push(msg)
          if (!doNext) {
            next()
          }
        }
      }

      while (doNext) {
        decoded = false
        _decodeFromReader(reader, opts, decodeCb)
        if (!decoded) {
          doNext = false
        }
      }
    }
function next () {
      let doNext = true
      let decoded = false

      const decodeCb = (err, msg) => {
        decoded = true
        if (err) {
          p.end(err)
          doNext = false
        } else {
          p.push(msg)
          if (!doNext) {
            next()
          }
        }
      }

      while (doNext) {
        decoded = false
        _decodeFromReader(reader, opts, decodeCb)
        if (!decoded) {
          doNext = false
        }
      }
    }
function next ( ) { let doNext = true let decoded = false const decodeCb = ( err , msg ) => { decoded = true if ( err ) { p . end ( err ) doNext = false } else { p . push ( msg ) if ( ! doNext ) { next ( ) } } } while ( doNext ) { decoded = false _decodeFromReader ( reader , opts , decodeCb ) if ( ! decoded ) { doNext = false } } }
this function has to be written without recursion or it blows the stack in case of sync stream
this function has to be written without recursion or it blows the stack in case of sync stream