Comparing version 0.3.3 to 1.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12279
287
0
73