Skip to content

Commit

Permalink
feat: fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvdkolk committed Feb 27, 2022
1 parent 0f0aa68 commit c833873
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ import Api from './lib/api';
export * from './interfaces';

export default Api;

export { Api };
2 changes: 1 addition & 1 deletion src/interfaces/Config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface Config {
baseUrl: string;
baseUrl?: string;
accessToken?: string;
}
4 changes: 2 additions & 2 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default class Api {

search: SearchManager;

constructor(config: Config) {
if (!config.baseUrl) {
constructor(config: Config = {}) {
if (!config?.baseUrl) {
config.baseUrl = 'https://api.stats.fm/api/v1';
}
this.http = new HttpClient(config);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/http/HttpManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class HttpClient {
throw parsed;
}

return parsed as Response;
return parsed;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"removeComments": false,
"sourceMap": true,
"baseUrl": "./",
"lib": ["ES2020"],
"lib": ["ES2020", "DOM"],
"rootDir": "src",
"declaration": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit c833873

Please sign in to comment.