Added tests for through

This commit is contained in:
Andrew Gaspar
2013-08-15 21:41:33 -05:00
parent e4c97e410c
commit 37c0cec6d4
2 changed files with 30 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import through = require('through');
var i = 0;
through(
function () {
this.queue((i++).toString());
}, function () {
this.queue(null);
}, { autoDestroy: true }).pipe(process.stdout);
+21
View File
@@ -0,0 +1,21 @@
/// <reference path="../node/node.d.ts" />
declare module "through" {
import Stream = require("stream");
function through(write: (data) => void,
end?: () => void,
opts?: {
autoDestroy: boolean;
}): through.ThroughStream;
module through {
export interface ThroughStream extends Stream.ReadWriteStream {
autoDestroy: boolean;
}
}
export = through;
}