dignifiedquire / pull-length-prefixed

Streaming length prefixed buffers with pull-streams
MIT License
8 stars 18 forks source link

Fix default maxLength and update deps #13

Closed jacobheun closed 6 years ago

jacobheun commented 6 years ago

There are two commits in here; a fix and an update for the dependencies. Happy to separate them into separate PRs if you'd like.

Default maxLength

Currently the maxLength is only being specified if the param is not given to readFixedMessage or readVarintMessage. The problem with that is that both functions are private and they are always called with maxLength, even if it's undefined. I set the default maxLength on the opts prior to those functions being called so it always exists. I also removed the, maxLength is the callback, check inside those methods, as it's not needed since they are private and we always supply the maxLength.

String literals were being passed as errors, which also breaks linting, so I turned those into actual errors and updated the tests.

Dependency Updates

The major update here is to the latest version of Aegir, which required npm script updates. It also includes the latest pull-reader (1.3.0), which adds the support needed for #8.

dignifiedquire commented 6 years ago

Thanks, can you rebase on master please, there are conflicts after I merged

15

jacobheun commented 6 years ago

@dignifiedquire good to go!

dignifiedquire commented 6 years ago

Thanks :octocat: