assemble-streams
Advanced tools
Comparing version 0.2.0 to 0.2.1
19
index.js
@@ -10,5 +10,5 @@ /*! | ||
var utils = require('./utils'); | ||
module.exports = function fn(app) { | ||
var utils = require('./utils'); | ||
@@ -30,3 +30,3 @@ /** | ||
app.mixin('toStream', function (name) { | ||
app.mixin('toStream', function (name, filterFn) { | ||
var stream = utils.through.obj(); | ||
@@ -50,4 +50,6 @@ var src = utils.srcStream; | ||
for (var key in views) { | ||
var view = views[key]; | ||
stream.write(view); | ||
if (!filter(key, views[key], filterFn)) { | ||
continue; | ||
} | ||
stream.write(views[key]); | ||
} | ||
@@ -60,3 +62,10 @@ stream.end(); | ||
if (app.isApp) return fn; | ||
}; | ||
}; | ||
function filter(key, view, fn) { | ||
if (typeof fn === 'function') { | ||
return fn(key, view); | ||
} | ||
return true; | ||
} |
{ | ||
"name": "assemble-streams", | ||
"description": "Assemble plugin that adds convenience methods for working with streams, like `toStream`, which pushes a view collection into a vinyl stream.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/jonschlinkert/assemble-streams", | ||
@@ -24,3 +24,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"lazy-cache": "^0.2.3", | ||
"lazy-cache": "^0.2.4", | ||
"src-stream": "^0.1.1", | ||
@@ -31,3 +31,3 @@ "through2": "^2.0.0" | ||
"mocha": "*", | ||
"templates": "^0.3.1" | ||
"templates": "^0.5.0" | ||
}, | ||
@@ -49,2 +49,2 @@ "keywords": [ | ||
} | ||
} | ||
} |
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
6363
70
Updatedlazy-cache@^0.2.4