module-deps
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -21,3 +21,4 @@ var fs = require('fs'); | ||
var entries = mains.map(function (file) { | ||
if (file && typeof file.pipe === 'function') { | ||
if (file.path) return file.path; | ||
if (typeof file.pipe === 'function') { | ||
var n = Math.floor(Math.pow(16,8) * Math.random()).toString(16); | ||
@@ -24,0 +25,0 @@ return path.join(basedir, 'fake_' + n + '.js'); |
{ | ||
"name": "module-deps", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "walk the dependency graph to generate json output that can be fed into browser-pack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,1 +25,19 @@ var parser = require('../'); | ||
}); | ||
test('infer path from fs-like streams', function (t) { | ||
t.plan(2); | ||
var path = 'foo-path' | ||
var stream = through(); | ||
stream.path = path | ||
var p = parser(stream); | ||
p.on('error', t.fail.bind(t)); | ||
p.on('data', function(result) { | ||
t.ok(!result.id.match(/fake/), "id should not be autogenerated") | ||
t.equal(result.id, path, "id should be stream path property") | ||
}); | ||
stream.queue(''); | ||
stream.queue(null); | ||
}); |
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
35473
831