assemble-fs
Advanced tools
Comparing version 0.3.6 to 0.3.7
33
index.js
@@ -31,3 +31,2 @@ /*! | ||
if (this.isRegistered('assemble-fs')) return; | ||
var vfs = utils.vfs; | ||
@@ -77,5 +76,5 @@ // assume none of the handlers exist if `onStream` does not exist | ||
var opts = utils.extend({ allowEmpty: true }, options); | ||
return vfs.src(glob, opts) | ||
return utils.vfs.src(glob, opts) | ||
.pipe(toCollection(this, opts)) | ||
.pipe(handle(this, 'onStream')) | ||
.pipe(utils.handle(this, 'onStream')) | ||
}); | ||
@@ -95,3 +94,3 @@ | ||
app.mixin('symlink', function() { | ||
return vfs.symlink.apply(vfs, arguments); | ||
return utils.vfs.symlink.apply(utils.vfs, arguments); | ||
}); | ||
@@ -117,5 +116,5 @@ | ||
var output = utils.combine([ | ||
handle(this, 'preWrite'), | ||
vfs.dest.apply(vfs, arguments), | ||
handle(this, 'postWrite') | ||
utils.handle(this, 'preWrite'), | ||
utils.vfs.dest.apply(utils.vfs, arguments), | ||
utils.handle(this, 'postWrite') | ||
]); | ||
@@ -129,22 +128,2 @@ | ||
/** | ||
* Plugin for handling middleware | ||
* | ||
* @param {Object} `app` Instance of "app" (assemble, verb, etc) or a collection | ||
* @param {String} `stage` the middleware stage to run | ||
*/ | ||
function handle(app, stage) { | ||
return utils.through.obj(function(file, enc, next) { | ||
if (typeof app.handle !== 'function') { | ||
return next(null, file); | ||
} | ||
if (typeof file.options === 'undefined') { | ||
return next(null, file); | ||
} | ||
if (file.isNull()) return next(); | ||
app.handle(stage, file, next); | ||
}); | ||
} | ||
/** | ||
* Push vinyl files into a collection or list. | ||
@@ -151,0 +130,0 @@ */ |
{ | ||
"name": "assemble-fs", | ||
"description": "Assemble plugin to add methods to assemble for working with the file system, like src, dest, copy and symlink.", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"homepage": "https://github.com/assemble/assemble-fs", | ||
@@ -24,2 +24,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"assemble-handle": "^0.1.0", | ||
"extend-shallow": "^2.0.1", | ||
@@ -26,0 +27,0 @@ "lazy-cache": "^1.0.3", |
@@ -11,2 +11,3 @@ 'use strict'; | ||
require = utils; | ||
require('assemble-handle', 'handle'); | ||
require('extend-shallow', 'extend'); | ||
@@ -13,0 +14,0 @@ require('through2', 'through'); |
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
10525
6
149
+ Addedassemble-handle@^0.1.0
+ Addedassemble-handle@0.1.4(transitive)