Skip to content

Commit

Permalink
Merge dc2ca65 into 86e4382
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rmat1k committed Nov 17, 2015
2 parents 86e4382 + dc2ca65 commit 0cfa3d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -52,6 +52,8 @@ function normalize(dep, options) {

if (dep.elems) {
dep.elems.forEach(function(elem) {
if (elem === '') return;

res.push(extend({ elem: elem }, dep));
});
}
Expand Down
4 changes: 4 additions & 0 deletions test/index.js
Expand Up @@ -20,6 +20,10 @@ describe('constructor', function () {
nomralize(undefined).should.be.eql([]);
});

it("shouldn't return empty elems", function () {
nomralize({ elems: [''] }).should.eql([]);
});

it('should wrap objects into array', function () {
var obj = {block: 'block'};
nomralize(obj).should.eql([obj]);
Expand Down

0 comments on commit 0cfa3d9

Please sign in to comment.