UNPKG

tricks

Version:
10 lines (9 loc) 345 B
// Param // Explode/encode the parameters of an URL string/object // @param string s, string to decode export default (hash, delimiter = '&', seperator = '=', formatFunction = o => o) => Object.keys(hash).map(name => { const value = formatFunction(hash[name]); return name + (value !== null ? seperator + value : ''); }).join(delimiter) ;