feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.44k stars 975 forks source link

fix: return `this` from `destroy()` #855

Open danielroe opened 2 years ago

danielroe commented 2 years ago

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [x] Bug fix [ ] New feature [ ] Other, please explain:

What changes did you make? (Give an overview)

This simply returns this from destroy() - quite a minor change but which brings the implemenation of Duplex into line with current Node implementation.

Which issue (if any) does this pull request address?

For consistency with Node readable stream implementation, destroy() should return this - https://nodejs.org/api/stream.html#readabledestroyerror

Is there anything you'd like reviewers to focus on?

Context: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57473

rprata commented 2 years ago

News about this PR?

ViniciusFXavier commented 2 years ago

@feross pls you can review this PR ?