amdextract
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -119,6 +119,6 @@ /* | ||
return paths[dependencies.indexOf(dependency)]; | ||
}).concat(paths.slice(dependencies.length)).filter(function(p) { | ||
return !isException(exceptsPaths, p.path); | ||
}); | ||
unusedPaths = unusedPaths.concat(paths.slice(dependencies.length)); | ||
results.push({ | ||
@@ -125,0 +125,0 @@ moduleId: moduleId, |
{ | ||
"name": "amdextract", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Extracts AMD modules and their parts.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -116,2 +116,3 @@ # amdextract | ||
## Release History | ||
* 2014-03-16 v0.1.6 Fix a bug related to unused paths. | ||
* 2014-03-15 v0.1.5 Add the ability to parse empty modules. | ||
@@ -122,2 +123,1 @@ * 2014-03-06 v0.1.3 Detects paths without corresponding dependency as unused. | ||
* 2014-01-13 v0.1.0 Works on files with multiple modules. Can detect module id if provided. Can remove unused dependencies. Add the new `exceptsPaths` option. Options `excepts` and `exceptsPaths` can take RegExps. | ||
// General test for all cases. | ||
/* exceptsPaths: p3 */ | ||
define('name', ["p2", "p3"], function (b, c) { | ||
define('name', ["p2", 'p3', "t5", 'm6', 'm7'], function (b, c) { | ||
/** | ||
@@ -6,0 +6,0 @@ * a.fetch() must not be encountered as code. |
// General test for all cases. | ||
/* exceptsPaths: p3 */ | ||
define('name', ["p1", "p2", "p3", "p4"], function (a, b, c) { | ||
define('name', ["p1", "p2", 'p3', "p4", "t5", 'm6', 'm7'], function (a, b, c) { | ||
/** | ||
@@ -6,0 +6,0 @@ * a.fetch() must not be encountered as code. |
@@ -111,7 +111,7 @@ var amdextract = require('..'); | ||
describe('general test', function() { | ||
var output = parse('sample', { removeUnusedDependencies: true }); | ||
var output = parse('sample', { removeUnusedDependencies: true, exceptsPaths: ['t5', /^m/] }); | ||
var result = output.results[0]; | ||
var optimizedContent = read('sample-optimized'); | ||
it('.moduleId', function() { should(result.moduleId).equal('name'); }); | ||
it('.paths', function() { result.paths.should.be.eql(['p1', 'p2', 'p3', 'p4']); }); | ||
it('.paths', function() { result.paths.should.be.eql(['p1', 'p2', 'p3', 'p4', 't5', 'm6', 'm7']); }); | ||
it('.dependencies', function() { result.dependencies.should.be.eql(['a', 'b', 'c']); }); | ||
@@ -118,0 +118,0 @@ it('.unusedPaths', function() { result.unusedPaths.should.be.eql(['p1', 'p4']); }); |
17081
265