src/js/libs/spiritual-gui.js
function(value) {
		if ([
			['%5B', '%5D'],
			['%7B', '%7D']
		].some(function isencoded(tokens) {
			return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
		})) {
			try {
				value = JSON.parse(decodeURIComponent(value));
			} catch (exception) {
				value = null;
				console.error(this + ': Bad JSON: ' + exception.message);
			}
		}
		return value;
	}
function(value) {
		if ([
			['%5B', '%5D'],
			['%7B', '%7D']
		].some(function isencoded(tokens) {
			return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
		})) {
			try {
				value = JSON.parse(decodeURIComponent(value));
			} catch (exception) {
				value = null;
				console.error(this + ': Bad JSON: ' + exception.message);
			}
		}
		return value;
	}
function ( value ) { if ( [ [ '%5B' , '%5D' ] , [ '%7B' , '%7D' ] ] . some ( function isencoded ( tokens ) { return value . startsWith ( tokens [ 0 ] ) && value . endsWith ( tokens [ 1 ] ) ; } ) ) { try { value = JSON . parse ( decodeURIComponent ( value ) ) ; } catch ( exception ) { value = null ; console . error ( this + ': Bad JSON: ' + exception . message ) ; } } return value ; }
JSONArray or JSONObject scrambled with encodeURIComponent?
If so, let's decode and parse this into an array or object.
@param {string} value
@returns {Array|Object>}
JSONArray or JSONObject scrambled with encodeURIComponent? If so let s decode and parse this into an array or object .