broccoli-funnel
Advanced tools
Comparing version 0.2.13 to 0.2.14
10
index.js
@@ -196,4 +196,3 @@ 'use strict'; | ||
// the destination paths "absolute" is actually stlil relative to the FSTree | ||
entry.relativePath = ensureRelative(this.lookupDestinationPath(ensureRelative(path.join(this.destDir, relativePath)))); | ||
entry.relativePath = this.lookupDestinationPath(relativePath); | ||
@@ -211,3 +210,3 @@ this.outputToInputMappings[entry.relativePath] = relativePath; | ||
map(function(relativePath) { | ||
var output = ensureRelative(this.lookupDestinationPath(ensureRelative(path.join(this.destDir, relativePath)))); | ||
var output = this.lookupDestinationPath(relativePath); | ||
this.outputToInputMappings[output] = relativePath; | ||
@@ -308,7 +307,8 @@ return output; | ||
// the destDir is absolute to prevent '..' above the output dir | ||
if (this.getDestinationPath) { | ||
return this._destinationPathCache[relativePath] = this.getDestinationPath(relativePath); | ||
return this._destinationPathCache[relativePath] = ensureRelative(path.join(this.destDir, this.getDestinationPath(relativePath))); | ||
} | ||
return this._destinationPathCache[relativePath] = relativePath; | ||
return this._destinationPathCache[relativePath] = ensureRelative(path.join(this.destDir, relativePath)); | ||
}; | ||
@@ -315,0 +315,0 @@ |
{ | ||
"name": "broccoli-funnel", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "Broccoli plugin that allows you to filter files selected from an input node down based on regular expressions.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -708,2 +708,27 @@ 'use strict'; | ||
}); | ||
it('receives relative inputPath as argument and can escape destDir with ..', function() { | ||
var inputPath = fixturePath + '/lib'; | ||
var node = new Funnel(inputPath, { | ||
destDir: 'utility', | ||
getDestinationPath: function(relativePath) { | ||
if (relativePath === 'main.js') { | ||
return '../utility.js'; | ||
} | ||
return relativePath; | ||
} | ||
}); | ||
builder = new broccoli.Builder(node); | ||
return builder.build().then(function(results) { | ||
var outputPath = results.directory; | ||
expect(walkSync(outputPath)).to.eql([ | ||
'utility/', | ||
'utility/utils/', | ||
'utility/utils/foo.js', | ||
'utility/utils.js', | ||
'utility.js' | ||
]); | ||
}); | ||
}); | ||
}); | ||
@@ -710,0 +735,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
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
47600
18
980