refactor: update makeURLSearchParams to accept readonly non-Records (#8868)

This commit is contained in:
Aura Román
2022-11-28 09:20:27 +01:00
committed by GitHub
parent ed68a1af5b
commit 8376e2dbcd
2 changed files with 28 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ function serializeSearchParam(value: unknown): string | null {
* @param options - The options to use
* @returns A populated URLSearchParams instance
*/
export function makeURLSearchParams(options?: Record<string, unknown>) {
export function makeURLSearchParams<T extends object>(options?: Readonly<T>) {
const params = new URLSearchParams();
if (!options) return params;