Use object instead of Record here
This commit is contained in:
parent
e2abc312d3
commit
734ecccb9c
1 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ export type EncodedBody = {
|
||||||
body: BlobHandle | string;
|
body: BlobHandle | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function encodeQueryParams(queryParams?: Record<string, any>): string {
|
export function encodeQueryParams(queryParams?: object): string {
|
||||||
return Object.entries(queryParams || {})
|
return Object.entries(queryParams || {})
|
||||||
.filter(([, value]) => value !== undefined)
|
.filter(([, value]) => value !== undefined)
|
||||||
.map(([name, value]) => {
|
.map(([name, value]) => {
|
||||||
|
@ -34,7 +34,7 @@ export function encodeQueryParams(queryParams?: Record<string, any>): string {
|
||||||
.join("&");
|
.join("&");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function encodeBody(body: BlobHandle | Record<string, any>): EncodedBody {
|
export function encodeBody(body: BlobHandle | object): EncodedBody {
|
||||||
if (body instanceof BlobHandle) {
|
if (body instanceof BlobHandle) {
|
||||||
const blob = body as BlobHandle;
|
const blob = body as BlobHandle;
|
||||||
return {
|
return {
|
||||||
|
|
Reference in a new issue