MCPcopy
hub / github.com/binux/qiandao / toKeyValue

Function toKeyValue

web/static/components/angularjs/angular.js:1220–1234  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1218}
1219
1220function toKeyValue(obj) {
1221 var parts = [];
1222 forEach(obj, function(value, key) {
1223 if (isArray(value)) {
1224 forEach(value, function(arrayValue) {
1225 parts.push(encodeUriQuery(key, true) +
1226 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1227 });
1228 } else {
1229 parts.push(encodeUriQuery(key, true) +
1230 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1231 }
1232 });
1233 return parts.length ? parts.join('&') : '';
1234}
1235
1236
1237/**

Callers 3

LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 4

forEachFunction · 0.85
isArrayFunction · 0.85
encodeUriQueryFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected