signoz/frontend/src/lib/query/convertObjectIntoParams.ts
Palash Gupta e62e541fc4
FE: added more eslint rule (#2090)
* chore: arrow-body-style func-style is added in the rule

* fix: linting issues fixed

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-01-24 18:53:04 +05:30

15 lines
291 B
TypeScript

const convertObjectIntoParams = (
props: Record<string, unknown>,
stringify = false,
): string =>
Object.keys(props)
.map(
(e) =>
`${e}=${
stringify ? encodeURIComponent(JSON.stringify(props[e])) : props[e]
}`,
)
.join('&');
export default convertObjectIntoParams;