truman-qs
v1.0.0
Published
qs项目
Downloads
2
Readme
qs
module.exports.parse = function(params) {
let obj = {}
let arr = params.split('&')
arr.forEach(item => {
let tmp = item.split('=')
let bl = tmp[0]
obj[bl] = tmp[1]
})
return obj
}
module.exports.stringify = function(obj) {
let arr = []
for (let key in obj) {
arr.push(${key}=${obj[key]}
)
}
return arr.join('&')
}