MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / toKeyValue

Function toKeyValue

code/songhop/www/lib/angular/angular.js:1130–1144  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1128}
1129
1130function toKeyValue(obj) {
1131 var parts = [];
1132 forEach(obj, function(value, key) {
1133 if (isArray(value)) {
1134 forEach(value, function(arrayValue) {
1135 parts.push(encodeUriQuery(key, true) +
1136 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1137 });
1138 } else {
1139 parts.push(encodeUriQuery(key, true) +
1140 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1141 }
1142 });
1143 return parts.length ? parts.join('&') : '';
1144}
1145
1146
1147/**

Callers 3

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 2

forEachFunction · 0.70
encodeUriQueryFunction · 0.70

Tested by

no test coverage detected