Skip to content

Commit

Permalink
Merge pull request #7 from f0rmat1k/master
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
floatdrop committed Jan 30, 2015
2 parents 95fe429 + 7daf926 commit 6055857
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -81,11 +81,11 @@ function normalize(dep, options) {
return res;
}

module.exports = function (deps) {
module.exports = function (deps, options) {
if (!deps) { return []; }
if (!Array.isArray(deps)) { deps = [ deps ]; }

return deps.reduce(function (previous, current) {
return previous.concat(normalize(current));
return previous.concat(normalize(current, options));
}, []);
};
9 changes: 3 additions & 6 deletions test/index.js
Expand Up @@ -5,12 +5,9 @@ require('should');

describe('constructor', function () {
it('should support custom string parsing', function () {
it('should support string', function () {
nomralize('jquery', {parseString: function (dep) {
return { block: 'custom', elem: dep };
}})
.should.eql([{ block: 'custom', elem: 'jquery' }]);
});
nomralize('jquery', {parseString: function (dep) {
return { block: 'custom', elem: dep };
}}).should.eql([{ block: 'custom', elem: 'jquery' }]);
});

it('should throw expection on empty object', function () {
Expand Down

0 comments on commit 6055857

Please sign in to comment.