mem-fs-editor
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -9,10 +9,13 @@ 'use strict'; | ||
context = context || {}; | ||
// Setting filename by default allow including partials. | ||
tplSettings = extend({filename: from}, tplSettings || {}); | ||
this.copy(from, to, { | ||
process: function (contents) { | ||
return ejs.render(contents.toString(), context, tplSettings); | ||
process: function (contents, filename) { | ||
return ejs.render( | ||
contents.toString(), | ||
context, | ||
// Setting filename by default allow including partials. | ||
extend({filename: filename}, tplSettings || {}) | ||
); | ||
} | ||
}); | ||
}; |
@@ -12,4 +12,4 @@ 'use strict'; | ||
function applyProcessingFunc(process, contents) { | ||
var output = process(contents); | ||
function applyProcessingFunc(process, contents, filename) { | ||
var output = process(contents, filename); | ||
return output instanceof Buffer ? output : new Buffer(output); | ||
@@ -52,3 +52,3 @@ } | ||
if (options.process) { | ||
contents = applyProcessingFunc(options.process, file.contents); | ||
contents = applyProcessingFunc(options.process, file.contents, file.path); | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -12,3 +12,3 @@ 'use strict'; | ||
file.state = 'deleted'; | ||
file.contents = new Buffer(''); | ||
file.contents = null; | ||
store.add(file); | ||
@@ -15,0 +15,0 @@ } |
{ | ||
"name": "mem-fs-editor", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "File edition helpers working on top of mem-fs", | ||
@@ -19,3 +19,3 @@ "scripts": { | ||
"ejs": "^2.3.1", | ||
"glob": "^6.0.1", | ||
"glob": "^7.0.3", | ||
"globby": "^4.0.0", | ||
@@ -22,0 +22,0 @@ "mkdirp": "^0.5.0", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
264
0
9261
14
1
0
Updatedglob@^7.0.3