MCPcopy
hub / github.com/angular-ui/ui-router / toKeyValue

Function toKeyValue

test/angular/1.7/angular.js:1574–1588  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

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

Callers 1

normalizePathFunction · 0.70

Calls 3

isArrayFunction · 0.85
forEachFunction · 0.70
encodeUriQueryFunction · 0.70

Tested by

no test coverage detected