Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const queryBuilder = function(objParams){
- if("[object Object]" === Object.prototype.toString.call(objParams)){
- const arrKeys = Object.keys(objParams)
- if(arrKeys.length>0){
- return arrKeys.map(function(key) {
- let value = objParams[key];
- if(null != value && "undefined" !== typeof value){
- return key + '=' + objParams[key]
- }
- }).join('&')
- }
- }
- return ""
- }
- export const urlBuilder = function(url,objParams){
- return url + "?" + queryBuilder(objParams);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement