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

Function toKeyValue

test/angular/1.2/angular.js:1227–1241  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1225}
1226
1227function toKeyValue(obj) {
1228 var parts = [];
1229 forEach(obj, function(value, key) {
1230 if (isArray(value)) {
1231 forEach(value, function(arrayValue) {
1232 parts.push(encodeUriQuery(key, true) +
1233 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1234 });
1235 } else {
1236 parts.push(encodeUriQuery(key, true) +
1237 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1238 }
1239 });
1240 return parts.length ? parts.join('&') : '';
1241}
1242
1243
1244/**

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