Skip to content

Commit

Permalink
Fixes a bug in the options handling
Browse files Browse the repository at this point in the history
  • Loading branch information
larrifax committed Mar 7, 2015
1 parent dee32b7 commit 558f364
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
var ngAnnotate = require("ng-annotate");
var loaderUtils = require("loader-utils");

function isEmpty(obj) {
return Object.keys(obj).length === 0;
}

module.exports = function (content, map) {
var callback = this.async();
this.cacheable && this.cacheable();

var options = loaderUtils.parseQuery(this.query) || { add: true };
var query = loaderUtils.parseQuery(this.query);
var options = isEmpty(query) ? { add: true } : query;
var result = ngAnnotate(content, options);

if (result.errors) {
Expand Down

0 comments on commit 558f364

Please sign in to comment.