1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 1 2 2 7 2 1 | define(['../object/forOwn'], function (forOwn) {
/**
* Encode object into a query string.
*/
function encode(obj){
var query = [];
forOwn(obj, function(val, key){
query.push( key +'='+ encodeURIComponent(val) );
});
return (query.length)? '?'+ query.join('&') : '';
}
return encode;
});
|