Both JSON and YAML are heavily url-encoded.
I ended up with Rison, which only encode strings (to single quotes 'string') if needed. Also, arrays are !(a,1), instead of ["a",1].
'string'
!(a,1)
["a",1]
But indeed, I know that the original Rison project is dead. π’
$axios.defaults.paramsSerializer = (params) => { return Object.entries<any>(params) .map(([k, v]) => { if ( [ '_', ...someTroublesomeKeys, ].includes(k) || /^is[A-Z]/.test(k) ) { v = rison.encode(v) } return `${encodeURIComponent(k)}=${encodeURIComponent(v)}` }) .join('&') }
FYI, there is a better maintained fork: github.com/w33ble/rison-node
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Both JSON and YAML are heavily url-encoded.
I ended up with Rison, which only encode strings (to single quotes
'string'
) if needed. Also, arrays are!(a,1)
, instead of["a",1]
.But indeed, I know that the original Rison project is dead. π’
FYI, there is a better maintained fork: github.com/w33ble/rison-node