protected ToQueryString(q: any): string {
const params = new URLSearchParams(q);
const keysForDel: any[] = [];
params.forEach((value, key) => {
if (value == '') {
keysForDel.push(key);
}
});
keysForDel.forEach(key => {
params.delete(key);
});
return decodeURI(params.toString());
}
Created
July 7, 2023 15:58
-
-
Save blanks88/e088d7857e30545cb17f2849caa0fe9f to your computer and use it in GitHub Desktop.
Typescript: Function to convert any object into querystring
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment