@worker-tools/json-fetch
Advanced tools
Comparing version 2.0.7-pre.1 to 2.0.7-pre.2
{ | ||
"name": "@worker-tools/json-fetch", | ||
"version": "2.0.7-pre.1", | ||
"version": "2.0.7-pre.2", | ||
"description": "Drop-in replacement for fetch, Request, and Response with first class support for JSON objects", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,2 +0,5 @@ | ||
export declare type SearchParamsInit = URLSearchParams | [string, any][] | Record<string, any>; | ||
export declare type Stringable = { | ||
toString(...args: any[]): string; | ||
}; | ||
export declare type SearchParamsInit = URLSearchParams | [string, Stringable][] | Record<string, Stringable>; | ||
export declare class SearchParamsURL extends URL { | ||
@@ -3,0 +6,0 @@ constructor(url: string | URL, params?: SearchParamsInit | null, base?: string | URL); |
@@ -7,3 +7,3 @@ // This could be it's own module... | ||
? params | ||
: Object.entries(params || {}); | ||
: Object.entries(params !== null && params !== void 0 ? params : {}); | ||
for (const [k, v] of iterable) | ||
@@ -10,0 +10,0 @@ this.searchParams.append(k, v); |
@@ -1,2 +0,3 @@ | ||
export type SearchParamsInit = URLSearchParams | [string, any][] | Record<string, any>; | ||
export type Stringable = { toString(...args: any[]): string } | ||
export type SearchParamsInit = URLSearchParams | [string, Stringable][] | Record<string, Stringable>; | ||
@@ -13,5 +14,5 @@ // This could be it's own module... | ||
? params | ||
: Object.entries(params || {}); | ||
: Object.entries(params ?? {}); | ||
for (const [k, v] of iterable) | ||
this.searchParams.append(k, v); | ||
this.searchParams.append(k, v as string); | ||
} | ||
@@ -18,0 +19,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19285
200