Socket
Socket
Sign inDemoInstall

split

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split - npm Package Compare versions

Comparing version 0.3.3 to 1.0.0

4

index.js

@@ -19,2 +19,3 @@ //filter will reemit the data if cb(err,pass) pass is truthy

var maxLength = options && options.maxLength;
var trailing = options && options.trailing === false ? false : true
if('function' === typeof matcher)

@@ -59,3 +60,3 @@ mapper = matcher, matcher = null

next(this, decoder.end())
if(soFar != null)
if(trailing && soFar != null)
emit(this, soFar)

@@ -65,2 +66,1 @@ this.queue(null)

}
{
"name": "split",
"version": "0.3.3",
"version": "1.0.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "split a Text Stream into a Line Stream",

@@ -24,1 +24,24 @@ var it = require('it-is').style('colour')

}
exports ['ignore trailing buffers'] = function (test) {
var s = split(JSON.parse, null, {
trailing: false
})
, caughtError = false
, rows = []
s.on('error', function (err) {
caughtError = true
})
s.on('data', function (row) { rows.push(row) })
s.write('{"a":1}\n{"')
s.write('{ "')
s.end()
it(caughtError).equal(false)
it(rows).deepEqual([ { a: 1 } ])
test.done()
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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