diff --git a/index.js b/index.js index b4f5e49..827b3c6 100755 --- a/index.js +++ b/index.js @@ -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; -}; \ No newline at end of file +};