MCPcopy
hub / github.com/angular-ui/ui-router / toKeyValue

Function toKeyValue

test/angular/1.3/angular.js:1147–1161  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1145}
1146
1147function toKeyValue(obj) {
1148 var parts = [];
1149 forEach(obj, function(value, key) {
1150 if (isArray(value)) {
1151 forEach(value, function(arrayValue) {
1152 parts.push(encodeUriQuery(key, true) +
1153 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1154 });
1155 } else {
1156 parts.push(encodeUriQuery(key, true) +
1157 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1158 }
1159 });
1160 return parts.length ? parts.join('&') : '';
1161}
1162
1163
1164/**

Callers 3

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 3

isArrayFunction · 0.85
forEachFunction · 0.70
encodeUriQueryFunction · 0.70

Tested by

no test coverage detected