responsive-loader
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -11,10 +11,10 @@ "use strict"; | ||
function parseQuery(query) { | ||
if (query.substring(0, 1) !== '?') { | ||
if (query.substr(0, 1) !== '?') { | ||
throw new Error("A valid query string passed to parseQuery should begin with '?'"); | ||
} | ||
query = query.substring(1); | ||
query = query.substr(1); | ||
if (!query) { | ||
return {}; | ||
} | ||
if (query.substring(0, 1) === '{' && query.substring(-1) === '}') { | ||
if (query.substr(0, 1) === '{' && query.substr(-1) === '}') { | ||
return JSON5.parse(query); | ||
@@ -34,4 +34,4 @@ } | ||
} | ||
if (name.substring(-2) === '[]') { | ||
name = decodeURIComponent(name.substring(0, name.length - 2)); | ||
if (name.substr(-2) === '[]') { | ||
name = decodeURIComponent(name.substr(0, name.length - 2)); | ||
if (!Array.isArray(result[name])) { | ||
@@ -48,7 +48,7 @@ result[name] = []; | ||
else { | ||
if (arg.substring(0, 1) === '-') { | ||
result[decodeURIComponent(arg.substring(1))] = false; | ||
if (arg.substr(0, 1) === '-') { | ||
result[decodeURIComponent(arg.substr(1))] = false; | ||
} | ||
else if (arg.substring(0, 1) === '+') { | ||
result[decodeURIComponent(arg.substring(1))] = true; | ||
else if (arg.substr(0, 1) === '+') { | ||
result[decodeURIComponent(arg.substr(1))] = true; | ||
} | ||
@@ -55,0 +55,0 @@ else { |
{ | ||
"name": "responsive-loader", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A webpack loader for responsive images", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs.js", |
44133