Skip to content

Commit

Permalink
Small type improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
u12206050 committed May 31, 2024
1 parent d251430 commit ec08f47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/collectionExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,13 @@ class CollectionExporter implements IExporter {
/**
* Loads the items and updates the database
*
* @param loadedItems An array of items to load
* @param loadedItems An array of loaded items to sync with the database
* @param merge boolean indicating whether to merge the items or replace them, ie. delete all items not in the JSON
* @returns
*/
public async loadItems(loadedItems: Array<Item>, merge = false) {
if (merge && !loadedItems.length) return false;

const itemsSvc = await this._getService();
const { getKey, getPrimary, queryWithPrimary } = await this.settings();

Expand Down
2 changes: 1 addition & 1 deletion src/exportManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ExportManager {
try {
const finishUp = await this.exporters[i]!.exporter.load(merge);
await this._loadNextExporter(i + 1, merge);
if (finishUp) await finishUp();
if (typeof finishUp === 'function') await finishUp();
} catch (e) {
this.logger.error(`Failed loading "${this.exporters[i]!.exporter.name}".`);
throw e;
Expand Down

0 comments on commit ec08f47

Please sign in to comment.