From 3fd2d089d806c881d9a3f9d013a86a35f0864b32 Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Thu, 12 Oct 2023 19:09:58 +0200 Subject: [PATCH 1/2] Fix polyfill capitalilzation --- src/Client.ts | 4 ++-- src/ValidatePolyFilling.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index ac8a76831..398bd5bcd 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -16,7 +16,7 @@ import { HTTPClient } from "./HTTPClient"; import { HTTPClientFactory } from "./HTTPClientFactory"; import { ClientOptions } from "./IClientOptions"; import { Options } from "./IOptions"; -import { validatePolyFilling } from "./ValidatePolyFilling"; +import { validatePolyfilling } from "./ValidatePolyfilling"; export class Client { /** @@ -70,7 +70,7 @@ export class Client { * @param {ClientOptions} clientOptions - The options to instantiate the client object */ private constructor(clientOptions: ClientOptions) { - validatePolyFilling(); + validatePolyfilling(); for (const key in clientOptions) { if (Object.prototype.hasOwnProperty.call(clientOptions, key)) { this.config[key] = clientOptions[key]; diff --git a/src/ValidatePolyFilling.ts b/src/ValidatePolyFilling.ts index 53ec11823..aafe0db50 100644 --- a/src/ValidatePolyFilling.ts +++ b/src/ValidatePolyFilling.ts @@ -12,18 +12,18 @@ * @returns The true in case the Promise and fetch available, otherwise throws error */ -export const validatePolyFilling = (): boolean => { +export const validatePolyfilling = (): boolean => { if (typeof Promise === "undefined" && typeof fetch === "undefined") { const error = new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them."); - error.name = "PolyFillNotAvailable"; + error.name = "PolyfillNotAvailable"; throw error; } else if (typeof Promise === "undefined") { const error = new Error("Library cannot function without Promise. So, please provide polyfill for it."); - error.name = "PolyFillNotAvailable"; + error.name = "PolyfillNotAvailable"; throw error; } else if (typeof fetch === "undefined") { const error = new Error("Library cannot function without fetch. So, please provide polyfill for it."); - error.name = "PolyFillNotAvailable"; + error.name = "PolyfillNotAvailable"; throw error; } return true; From 5c7861da46f8fadac7d1868f26c2446ae7dfa13d Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Thu, 12 Oct 2023 19:10:05 +0200 Subject: [PATCH 2/2] Fix polyfill error grammar --- src/ValidatePolyFilling.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ValidatePolyFilling.ts b/src/ValidatePolyFilling.ts index aafe0db50..464cec9f4 100644 --- a/src/ValidatePolyFilling.ts +++ b/src/ValidatePolyFilling.ts @@ -14,15 +14,15 @@ export const validatePolyfilling = (): boolean => { if (typeof Promise === "undefined" && typeof fetch === "undefined") { - const error = new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them."); + const error = new Error("Library cannot function without Promise and fetch. So, please provide a polyfill for them."); error.name = "PolyfillNotAvailable"; throw error; } else if (typeof Promise === "undefined") { - const error = new Error("Library cannot function without Promise. So, please provide polyfill for it."); + const error = new Error("Library cannot function without Promise. So, please provide a polyfill for it."); error.name = "PolyfillNotAvailable"; throw error; } else if (typeof fetch === "undefined") { - const error = new Error("Library cannot function without fetch. So, please provide polyfill for it."); + const error = new Error("Library cannot function without fetch. So, please provide a polyfill for it."); error.name = "PolyfillNotAvailable"; throw error; }