Repository URL to install this package:
|
Version:
7.1.2 ▾
|
import { OneRequestStore } from '../typings'
const fromValueToFixed = (value: any) =>
value === undefined || value === null ? '' : value
/**
* @note currently only changing 1 level of params
*/
export function autoFixParams(store: OneRequestStore): void {
if (store.has('params') === false) {
return
}
const params = store.get('params')
const clonedParams = {}
Object.keys(params).forEach(key => {
const value = params[key]
clonedParams[key] = fromValueToFixed(value)
})
store.set('params', clonedParams)
}