MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / toKeyValue

Function toKeyValue

OpenReservation/wwwroot/Scripts/angular.js:1357–1373  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1355 }
1356
1357 function toKeyValue(obj) {
1358 var parts = [];
1359 forEach(obj,
1360 function (value, key) {
1361 if (isArray(value)) {
1362 forEach(value,
1363 function (arrayValue) {
1364 parts.push(encodeUriQuery(key, true) +
1365 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1366 });
1367 } else {
1368 parts.push(encodeUriQuery(key, true) +
1369 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1370 }
1371 });
1372 return parts.length ? parts.join('&') : '';
1373 }
1374
1375 /**
1376 * We need our custom method because encodeURIComponent is too aggressive and doesn't follow

Callers 3

LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 2

forEachFunction · 0.85
encodeUriQueryFunction · 0.85

Tested by

no test coverage detected