mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-22 06:21:37 +01:00
18 lines
490 B
TypeScript
18 lines
490 B
TypeScript
export const getHodlParams = (params: any): string => {
|
|
let paramString = '?';
|
|
|
|
for (const key in params) {
|
|
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
const element = params[key];
|
|
|
|
for (const subKey in element) {
|
|
if (Object.prototype.hasOwnProperty.call(element, subKey)) {
|
|
const subElement = element[subKey];
|
|
paramString = `${paramString}&${key}[${subKey}]=${subElement}`;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return paramString;
|
|
};
|