(obj)
| 1145 | } |
| 1146 | |
| 1147 | function 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 | /** |
no test coverage detected