MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / toKeyValue

Function toKeyValue

web/static/bower_components/angular/angular.js:1350–1364  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1348}
1349
1350function toKeyValue(obj) {
1351 var parts = [];
1352 forEach(obj, function(value, key) {
1353 if (isArray(value)) {
1354 forEach(value, function(arrayValue) {
1355 parts.push(encodeUriQuery(key, true) +
1356 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1357 });
1358 } else {
1359 parts.push(encodeUriQuery(key, true) +
1360 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1361 }
1362 });
1363 return parts.length ? parts.join('&') : '';
1364}
1365
1366
1367/**

Callers 3

LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 2

forEachFunction · 0.85
encodeUriQueryFunction · 0.70

Tested by

no test coverage detected