From 582ee0e4d7f00d23593d53b066cb27a6d7649aa0 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 31 Jan 2023 02:48:56 +0000 Subject: [PATCH] var => let git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4158 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/form.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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; } }