Skip to content

Commit

Permalink
deletes isarray function (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
oktaysenkan authored Mar 20, 2021
1 parent 74ababb commit 9ae93d0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ export function getAbsoluteUrl(baseUrl: string, relativeUrl?: string): string {
return baseUrl.replace(/\/+$/g, '') + '/' + relativeUrl.replace(/^\/+/g, '');
}

/**
* Returns whether or not the provided value is an array
*
* @param value the value
*/
export function isArray(value: any): boolean {
return Object.prototype.toString.call(value) === '[object Array]';
}

/**
* Returns the URL-encoded string representation of a value. If the provided value is null or undefined, returns an empty string.
*
Expand Down Expand Up @@ -76,7 +67,7 @@ export function serializeParams(params: any): string {
const value: any = params[key];
const encodedKey = encodeURIComponent(key);

if (isArray(value)) {
if (Array.isArray(value)) {
const stringValue = value
.map(getEncodedStringValue)
.map((value: string) => `${encodedKey}=${value}`)
Expand Down

0 comments on commit 9ae93d0

Please sign in to comment.