generated from alphane/template
Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import qs from "qs"
|
||||
|
||||
export function enhancedQsDecoder(params: string) {
|
||||
return qs.parse(params, {
|
||||
strictNullHandling: true,
|
||||
decoder(str, defaultDecoder, charset, type) {
|
||||
if (type === "value") {
|
||||
if (str === "true") return true
|
||||
if (str === "false") return false
|
||||
}
|
||||
|
||||
return defaultDecoder(str, defaultDecoder, charset)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export default enhancedQsDecoder
|
||||
Reference in New Issue
Block a user