MCPcopy Create free account
hub / github.com/apache/cloudstack / parseKeyValue

Function parseKeyValue

tools/ngui/static/js/lib/angular.js:825–835  ·  view source on GitHub ↗

* Parses an escaped url query string into key-value pairs. * @returns Object.<(string|boolean)>

(/**string*/keyValue)

Source from the content-addressed store, hash-verified

823 * @returns Object.<(string|boolean)>
824 */
825function parseKeyValue(/**string*/keyValue) {
826 var obj = {}, key_value, key;
827 forEach((keyValue || "").split('&'), function(keyValue){
828 if (keyValue) {
829 key_value = keyValue.split('=');
830 key = decodeURIComponent(key_value[0]);
831 obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
832 }
833 });
834 return obj;
835}
836
837function toKeyValue(obj) {
838 var parts = [];

Callers 3

LocationUrlFunction · 0.85
LocationHashbangUrlFunction · 0.85
angular.jsFile · 0.85

Calls 2

forEachFunction · 0.85
isDefinedFunction · 0.85

Tested by

no test coverage detected