MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / toKeyValue

Function toKeyValue

lib/test/angular/1.5.0/angular.js:1384–1398  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1382}
1383
1384function toKeyValue(obj) {
1385 var parts = [];
1386 forEach(obj, function(value, key) {
1387 if (isArray(value)) {
1388 forEach(value, function(arrayValue) {
1389 parts.push(encodeUriQuery(key, true) +
1390 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1391 });
1392 } else {
1393 parts.push(encodeUriQuery(key, true) +
1394 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1395 }
1396 });
1397 return parts.length ? parts.join('&') : '';
1398}
1399
1400
1401/**

Callers 3

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 3

forEachFunction · 0.70
encodeUriQueryFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected