Merge pull request #59 from fadhilx/main
Fix images array is empty because languages equal to undefined on URLSearchParams
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
export function parseOptions(options?: Record<string, any>): string {
|
||||
return options ? new URLSearchParams(Object.entries(options)).toString() : '';
|
||||
return options
|
||||
? new URLSearchParams(
|
||||
Object.entries(options)
|
||||
.filter(([k, v]) => v) // remove undefined
|
||||
).toString()
|
||||
: '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user