Skip to content

Commit 1d956b1

Browse files
committed
fix: 🚑️ fix failed @CodeRabbit commit
1 parent ffdf1ad commit 1d956b1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/services/readwise-api.ts

+11-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class TokenValidationError extends Error {
1515

1616
/**
1717
* Readwise API class
18-
*/
18+
*/
1919
export default class ReadwiseApi {
2020
private apiToken: string;
2121
private validToken: boolean | undefined;
@@ -64,12 +64,11 @@ export default class ReadwiseApi {
6464
* @returns {Promise<boolean>} - Returns a promise that resolves to a boolean indicating if the token is valid
6565
*/
6666
async hasValidToken(): Promise<boolean> {
67-
async hasValidToken(): Promise<boolean> {
68-
if (this.validToken === undefined) {
69-
this.validToken = await this.validateToken();
70-
}
71-
return this.validToken;
72-
}
67+
if (this.validToken === undefined) {
68+
this.validToken = await this.validateToken();
69+
}
70+
return this.validToken;
71+
}
7372

7473
/**
7574
* Checks if the token is valid by making a request to the Readwise API
@@ -92,7 +91,7 @@ export default class ReadwiseApi {
9291
* @param contentType - The type of content to fetch from the API
9392
* @param lastUpdated - The date to fetch updates from
9493
* @param bookId - The ID of the book to fetch highlights from
95-
* @returns {Promise<Export[]>} - Returns a promise that resolves to an array of Export objects
94+
* @returns {Promise<Export[]>} - Returns a promise that resolves to an array of Export objects
9695
* @throws {Error} - Throws an error if the request fails
9796
*/
9897
async fetchData(contentType = 'export', lastUpdated?: string, bookId?: number[]): Promise<Export[]> {
@@ -166,7 +165,7 @@ export default class ReadwiseApi {
166165
/**
167166
* Builds a library object from the fetched data
168167
* @param results - The fetched data from the Readwise API
169-
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
168+
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
170169
*/
171170
async buildLibrary(results: Export[]): Promise<Library> {
172171
const library: Library = {
@@ -189,7 +188,7 @@ export default class ReadwiseApi {
189188

190189
/**
191190
* Fetches all highlights from Readwise API
192-
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
191+
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
193192
*/
194193
async downloadFullLibrary(): Promise<Library> {
195194
const records = (await this.fetchData('export')) as Export[];
@@ -199,8 +198,8 @@ export default class ReadwiseApi {
199198

200199
/**
201200
* Fetches updates from Readwise API
202-
* @param lastUpdated - The date to fetch updates from
203-
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
201+
* @param lastUpdated - The date to fetch updates from
202+
* @returns {Promise<Library>} - Returns a promise that resolves to a Library object
204203
*/
205204
async downloadUpdates(lastUpdated: string): Promise<Library> {
206205
// Fetch updated books and then fetch all their highlights

0 commit comments

Comments
 (0)