diana
Version:
lightweight tool library
10 lines • 438 B
JavaScript
;
function obj2query(baseurl, obj) {
if (!obj)
return 'please check if the second params is Object';
var handleKey = Object.keys(obj).filter(function (key) { return obj[key] != null; });
var handleArray = handleKey.map(function (key) { return key + "=" + encodeURIComponent(obj[key]); });
return baseurl + '?' + handleArray.join('&');
}
module.exports = obj2query;
//# sourceMappingURL=obj2query.js.map