Skip to content

Commit

Permalink
Merge pull request #1 from gogu/master
Browse files Browse the repository at this point in the history
Good catch. Thanks!
  • Loading branch information
fongandrew authored Sep 2, 2016
2 parents 2606aa6 + 22259e3 commit dedac71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ module.exports = function(content) {
if (this.cacheable) { this.cacheable(); }

var query = loaderUtils.parseQuery(this.query);
if (typeof query === "object" && query.regex && query.sub) {
if (typeof query === "object" && query.regex && typeof query.sub === "string") {
var regex = new RegExp(query.regex, query.flags);
content = content.replace(regex, query.sub);
}

return content;
};
};

0 comments on commit dedac71

Please sign in to comment.