Repository URL to install this package:
|
Version:
7.1.0 ▾
|
/**
* @file @todo probably can be reused with oneRequest
*/
import { URLSearchParams } from 'url'
import { AnyObj } from '../typings'
function fromObjToSearchParamsString(to: AnyObj) {
const params = new URLSearchParams(window.location.search)
// const IS_ARRAY = isArray(to)
Object.keys(to).forEach(key => {
const value = to[key]
params.set(key, value)
})
return params
}