Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

it-goodbye

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-goodbye - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

15

index.js
const endable = require('./endable')
module.exports = (stream, goodbye) => {
goodbye = goodbye || 'GOODBYE'
goodbye = Buffer.from(goodbye || 'GOODBYE')
const e = endable(goodbye)

@@ -15,4 +15,13 @@

for await (const chunk of source) {
if (chunk !== goodbye) yield chunk
e.end()
const buff = Buffer.from(chunk)
const done = buff.slice(-goodbye.length).equals(goodbye)
if (done) {
const remaining = buff.length - goodbye.length
if (remaining > 0) {
yield buff.slice(0, remaining)
}
e.end()
} else {
yield buff
}
}

@@ -19,0 +28,0 @@ })())

2

package.json
{
"name": "it-goodbye",
"description": "Add a goodbye handshake to a duplex async iterable",
"version": "1.0.0",
"version": "2.0.0",
"homepage": "https://github.com/alanshaw/it-goodbye",

@@ -6,0 +6,0 @@ "repository": {

@@ -24,3 +24,2 @@ # it-goodbye

var goodbye = require('it-goodbye')
var serializer = require('it-serializer')

@@ -30,3 +29,3 @@ // a duplex stream from somewhere...

return serializer(goodbye(duplex, 'GoodBye'))
return goodbye(duplex, 'GoodBye')
```

@@ -33,0 +32,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc