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

Function toKeyValue

test/angular/1.6/angular.js:1577–1591  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1575}
1576
1577function toKeyValue(obj) {
1578 var parts = [];
1579 forEach(obj, function(value, key) {
1580 if (isArray(value)) {
1581 forEach(value, function(arrayValue) {
1582 parts.push(encodeUriQuery(key, true) +
1583 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1584 });
1585 } else {
1586 parts.push(encodeUriQuery(key, true) +
1587 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1588 }
1589 });
1590 return parts.length ? parts.join('&') : '';
1591}
1592
1593
1594/**

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