Skip to content

Commit 9fb3f3e

Browse files
committed
Merge branch 'refs/heads/master' into version-0.18.1
2 parents 31aaadd + 974cf50 commit 9fb3f3e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/musicbrainz-api.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export interface IMusicBrainzConfig {
131131
username?: string,
132132
password?: string
133133
},
134-
baseUrl: string,
134+
baseUrl?: string,
135135

136136
appName?: string,
137137
appVersion?: string,
@@ -149,6 +149,10 @@ export interface IMusicBrainzConfig {
149149
disableRateLimiting?: boolean
150150
}
151151

152+
interface IInternalConfig extends IMusicBrainzConfig {
153+
baseUrl: string,
154+
}
155+
152156
export interface ICsrfSession {
153157
sessionKey: string;
154158
token: string;
@@ -161,9 +165,7 @@ export interface ISessionInformation {
161165

162166
export class MusicBrainzApi {
163167

164-
public readonly config: IMusicBrainzConfig = {
165-
baseUrl: 'https://musicbrainz.org'
166-
};
168+
public readonly config: IInternalConfig;
167169

168170
private rateLimiter: RateLimitThreshold;
169171
private httpClient: HttpClient;
@@ -190,7 +192,12 @@ export class MusicBrainzApi {
190192

191193
public constructor(_config?: IMusicBrainzConfig) {
192194

193-
Object.assign(this.config, _config);
195+
this.config = {
196+
...{
197+
baseUrl: 'https://musicbrainz.org'
198+
},
199+
..._config
200+
}
194201

195202
this.httpClient = new HttpClient({
196203
baseUrl: this.config.baseUrl,

0 commit comments

Comments
 (0)