MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / toKeyValue

Function toKeyValue

test/fixtures/foo.js:1225–1239  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

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

Callers 3

LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 2

forEachFunction · 0.85
encodeUriQueryFunction · 0.85

Tested by

no test coverage detected