Comparing version 1.0.2 to 1.0.3
@@ -18,3 +18,5 @@ 'use strict' | ||
function via (throughFunction, options) { | ||
options = options || {} | ||
var stream = Transform(options) | ||
stream._transform = function (chunk, enc, done) { | ||
@@ -30,2 +32,9 @@ if (chunk) { | ||
} | ||
/* node 0.10 polyfil */ | ||
if (!options.objectMode) { | ||
if (options.readableObjectMode) stream._readableState.objectMode = true | ||
if (options.writableObjectMode) stream._writableState.objectMode = true | ||
} | ||
return stream | ||
@@ -32,0 +41,0 @@ } |
{ | ||
"name": "stream-via", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "stream-via", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/stream-via.git", |
@@ -94,1 +94,13 @@ var test = require('tape') | ||
}) | ||
test('via: readableObjectMode', function (t) { | ||
var stream = via( | ||
function (buf) { | ||
t.strictEqual(buf.toString(), 'yeah') | ||
return {} | ||
}, | ||
{ readableObjectMode: true } | ||
) | ||
stream.end('yeah') | ||
t.end() | ||
}) |
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
10695
181