Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

Commit

Permalink
fix WhaleApiClient options to create a new options everytime (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Aug 12, 2021
1 parent 68f5632 commit f6cb44c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/whale-api-client/src/whale.api.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface WhaleApiClientOptions {
/**
* WhaleApiClient default options
*/
export const DefaultOptions: WhaleApiClientOptions = {
const DEFAULT_OPTIONS: WhaleApiClientOptions = {
url: 'https://ocean.defichain.com',
timeout: 60000,
version: version,
Expand Down Expand Up @@ -78,7 +78,7 @@ export class WhaleApiClient {
constructor (
protected readonly options: WhaleApiClientOptions
) {
this.options = Object.assign(DefaultOptions, options ?? {})
this.options = { ...DEFAULT_OPTIONS, ...options }
this.options.url = this.options.url.replace(/\/$/, '')
}

Expand Down

0 comments on commit f6cb44c

Please sign in to comment.