@exceptionless/fetchclient
Advanced tools
Comparing version 0.11.5 to 0.11.7
@@ -24,6 +24,3 @@ import { Counter } from "./Counter.js"; | ||
this.#cache = options?.cache ?? new FetchClientCache(); | ||
this.#fetch = options?.fetch ?? globalThis.fetch; | ||
if (!this.#fetch) { | ||
throw new Error("No fetch implementation available"); | ||
} | ||
this.#fetch = options?.fetch; | ||
this.#providerCounter = options?.providerCounter ?? new Counter(); | ||
@@ -265,3 +262,3 @@ this.use(...(options?.middleware ?? [])); | ||
} | ||
const response = await this.#fetch(ctx.request); | ||
const response = await (this.#fetch ? this.#fetch(ctx.request) : fetch(ctx.request)); | ||
if (ctx.request.headers.get("Content-Type")?.startsWith("application/json") || | ||
@@ -268,0 +265,0 @@ ctx.request.headers.get("Accept")?.startsWith("application/json") || |
@@ -18,3 +18,3 @@ import { FetchClient } from "./FetchClient.js"; | ||
this.#cache = new FetchClientCache(); | ||
this.#fetch = fetch ?? globalThis.fetch; | ||
this.#fetch = fetch; | ||
} | ||
@@ -72,3 +72,3 @@ /** | ||
cache: this.#cache, | ||
fetch: this.#fetch, | ||
fetch: this.fetch, | ||
middleware: this.#options.middleware, | ||
@@ -75,0 +75,0 @@ modelValidator: this.#options.modelValidator, |
{ | ||
"name": "@exceptionless/fetchclient", | ||
"version": "0.11.5", | ||
"version": "0.11.7", | ||
"description": "A simple fetch client with middleware support for Deno and the browser.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -27,6 +27,3 @@ "use strict"; | ||
this.#cache = options?.cache ?? new FetchClientCache_js_1.FetchClientCache(); | ||
this.#fetch = options?.fetch ?? globalThis.fetch; | ||
if (!this.#fetch) { | ||
throw new Error("No fetch implementation available"); | ||
} | ||
this.#fetch = options?.fetch; | ||
this.#providerCounter = options?.providerCounter ?? new Counter_js_1.Counter(); | ||
@@ -268,3 +265,3 @@ this.use(...(options?.middleware ?? [])); | ||
} | ||
const response = await this.#fetch(ctx.request); | ||
const response = await (this.#fetch ? this.#fetch(ctx.request) : fetch(ctx.request)); | ||
if (ctx.request.headers.get("Content-Type")?.startsWith("application/json") || | ||
@@ -271,0 +268,0 @@ ctx.request.headers.get("Accept")?.startsWith("application/json") || |
@@ -21,3 +21,3 @@ "use strict"; | ||
this.#cache = new FetchClientCache_js_1.FetchClientCache(); | ||
this.#fetch = fetch ?? globalThis.fetch; | ||
this.#fetch = fetch; | ||
} | ||
@@ -75,3 +75,3 @@ /** | ||
cache: this.#cache, | ||
fetch: this.#fetch, | ||
fetch: this.fetch, | ||
middleware: this.#options.middleware, | ||
@@ -78,0 +78,0 @@ modelValidator: this.#options.modelValidator, |
@@ -19,3 +19,3 @@ import { FetchClient, type FetchClientOptions } from "./FetchClient.js"; | ||
*/ | ||
get fetch(): Fetch; | ||
get fetch(): Fetch | undefined; | ||
/** | ||
@@ -22,0 +22,0 @@ * Sets the fetch function used for making requests. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97293
2063
4