MCPcopy Index your code
hub / github.com/angular-ui/ui-router / toKeyValue

Function toKeyValue

test/angular/1.5/angular.js:1447–1461  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1445}
1446
1447function toKeyValue(obj) {
1448 var parts = [];
1449 forEach(obj, function(value, key) {
1450 if (isArray(value)) {
1451 forEach(value, function(arrayValue) {
1452 parts.push(encodeUriQuery(key, true) +
1453 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1454 });
1455 } else {
1456 parts.push(encodeUriQuery(key, true) +
1457 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1458 }
1459 });
1460 return parts.length ? parts.join('&') : '';
1461}
1462
1463
1464/**

Callers 3

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 3

isArrayFunction · 0.85
forEachFunction · 0.70
encodeUriQueryFunction · 0.70

Tested by

no test coverage detected