mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-19 00:17:00 +00:00
16 lines
288 B
TypeScript
16 lines
288 B
TypeScript
|
|
const convertObjectIntoParams = (
|
||
|
|
props: Record<any, any>,
|
||
|
|
stringify = false,
|
||
|
|
) => {
|
||
|
|
return Object.keys(props)
|
||
|
|
.map(
|
||
|
|
(e) =>
|
||
|
|
`${e}=${
|
||
|
|
stringify ? encodeURIComponent(JSON.stringify(props[e])) : props[e]
|
||
|
|
}`,
|
||
|
|
)
|
||
|
|
.join('&');
|
||
|
|
};
|
||
|
|
|
||
|
|
export default convertObjectIntoParams;
|