mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
split def. fix
This commit is contained in:
@@ -6,11 +6,11 @@ import split = require("split");
|
||||
|
||||
var testStream = new stream.Readable();
|
||||
|
||||
testStream.pipe = function(dest) {
|
||||
testStream.pipe = function(dest: stream.Writable) {
|
||||
dest.write("This is \r\n new \r\n line");
|
||||
return dest;
|
||||
};
|
||||
|
||||
testStream.pipe(split(/(\r?\n)/, null, {maxLength: 20})).on("data", function(line) {
|
||||
console.log("Line: " + line + "\r\n");
|
||||
testStream.pipe(split(/(\r?\n)/, null, {maxLength: 20})).on("data", function(line: Buffer) {
|
||||
console.log("Line: " + line.toString('ascii') + "\r\n");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user