Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix polyfill error grammar #1495

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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];
Expand Down
14 changes: 7 additions & 7 deletions src/ValidatePolyFilling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
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.");
error.name = "PolyFillNotAvailable";
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.");
error.name = "PolyFillNotAvailable";
const error = new Error("Library cannot function without fetch. So, please provide a polyfill for it.");
error.name = "PolyfillNotAvailable";
throw error;
}
return true;
Expand Down