split2
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -98,2 +98,7 @@ /* | ||
// objectMode default hwm is 16 and not 16384 | ||
if (stream._readableState.highWaterMark && !options.highWaterMark) { | ||
stream._readableState.highWaterMark = 16 | ||
} | ||
stream._last = '' | ||
@@ -100,0 +105,0 @@ stream._decoder = new StringDecoder('utf8') |
{ | ||
"name": "split2", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "split a Text Stream into a Line Stream, using Stream 3", | ||
@@ -26,4 +26,5 @@ "main": "index.js", | ||
"pre-commit": "^1.1.2", | ||
"standard": "^8.6.0", | ||
"tap": "^8.0.1" | ||
"safe-buffer": "^5.1.1", | ||
"standard": "^10.0.0", | ||
"tap": "^10.0.0" | ||
}, | ||
@@ -30,0 +31,0 @@ "dependencies": { |
@@ -16,3 +16,3 @@ # Split2(matcher, mapper, options) | ||
.on('data', function (line) { | ||
//each chunk now is a seperate line! | ||
//each chunk now is a separate line! | ||
}) | ||
@@ -22,3 +22,3 @@ | ||
`split` takes the same arguments as `string.split` except it defaults to '/\r?\n/' instead of ',', and the optional `limit` paremeter is ignored. | ||
`split` takes the same arguments as `string.split` except it defaults to '/\r?\n/', and the optional `limit` paremeter is ignored. | ||
[String#split](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split) | ||
@@ -61,3 +61,3 @@ | ||
.on('data', function (obj) { | ||
//each chunk now is a a js object | ||
//each chunk now is a js object | ||
}) | ||
@@ -64,0 +64,0 @@ ``` |
18
test.js
@@ -6,2 +6,3 @@ 'use strict' | ||
var callback = require('callback-stream') | ||
var Buffer = require('safe-buffer').Buffer | ||
var strcb = callback.bind(null, { decodeStrings: false }) | ||
@@ -133,3 +134,3 @@ var objcb = callback.bind(null, { objectMode: true }) | ||
input.end(new Buffer('hello\nworld')) | ||
input.end(Buffer.from('hello\nworld')) | ||
}) | ||
@@ -147,3 +148,3 @@ | ||
input.end(new Buffer('hello\nworld')) | ||
input.end(Buffer.from('hello\nworld')) | ||
}) | ||
@@ -234,3 +235,3 @@ | ||
var buf = new Buffer('烫烫烫\r\n锟斤拷', 'utf8') | ||
var buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8') | ||
for (var i = 0; i < buf.length; ++i) { | ||
@@ -253,3 +254,3 @@ input.write(buf.slice(i, i + 1)) | ||
var str = '烫烫烫\r\n烫烫烫' | ||
var buf = new Buffer(str, 'utf8') | ||
var buf = Buffer.from(str, 'utf8') | ||
for (var i = 0; i < buf.length; i += 2) { | ||
@@ -282,7 +283,7 @@ input.write(buf.slice(i, i + 2)) | ||
t.error(err) | ||
t.deepEqual(list, ['烫' + new Buffer('e7', 'hex').toString()]) | ||
t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()]) | ||
})) | ||
var str = '烫烫' | ||
var buf = new Buffer(str, 'utf8') | ||
var buf = Buffer.from(str, 'utf8') | ||
@@ -305,1 +306,6 @@ input.write(buf.slice(0, 3)) | ||
test('readable highWaterMark', function (t) { | ||
var input = split() | ||
t.equal(input._readableState.highWaterMark, 16) | ||
t.end() | ||
}) |
Sorry, the diff of this file is not supported yet
13849
324
6
7