diff --git a/core/form.js b/core/form.js index b40def3a..77e8e120 100644 --- a/core/form.js +++ b/core/form.js @@ -1,7 +1,7 @@ function decode(encoded) { - var result = ""; - for (var i = 0; i < encoded.length; i++) { - var c = encoded[i]; + let result = ""; + for (let i = 0; i < encoded.length; i++) { + let c = encoded[i]; if (c == "+") { result += " "; } else if (c == "%") { @@ -15,15 +15,15 @@ function decode(encoded) { } function decodeForm(encoded, initial) { - var result = initial || {}; + let result = initial || {}; if (encoded) { encoded = encoded.trim(); - var items = encoded.split('&'); - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var equals = item.indexOf('='); - var key = decode(item.slice(0, equals)); - var value = decode(item.slice(equals + 1)); + let items = encoded.split('&'); + for (let i = 0; i < items.length; i++) { + let item = items[i]; + let equals = item.indexOf('='); + let key = decode(item.slice(0, equals)); + let value = decode(item.slice(equals + 1)); result[key] = value; } }