verdnatura-chat/app/lib/methods/helpers/toQuery.js

4 lines
193 B
JavaScript

export default function(obj) {
return Object.keys(obj).filter(p => obj[p] !== undefined && obj[p] !== null).map(p => `${ encodeURIComponent(p) }=${ encodeURIComponent(obj[p]) }`).join('&');
}