Skip to content

Commit

Permalink
Deleting all unused files, deleting unused functions from loot-core (#…
Browse files Browse the repository at this point in the history
…1158)

Last one before I add the actual linter rules!
  • Loading branch information
Shazib authored Jun 23, 2023
1 parent d6ed860 commit 0c0f9e6
Show file tree
Hide file tree
Showing 30 changed files with 6 additions and 3,300 deletions.
65 changes: 0 additions & 65 deletions packages/desktop-client/src/components/SyncNotifications.js

This file was deleted.

143 changes: 0 additions & 143 deletions packages/desktop-client/src/components/debug/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions packages/desktop-client/src/util.ts

This file was deleted.

77 changes: 0 additions & 77 deletions packages/loot-core/src/server/api-models.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,5 @@
import * as models from './models';

export const transactionModel = {
...models.transactionModel,

toExternal(transactions, idx, payees) {
return transactions;
// function convert(t, payee) {
// return {
// id: t.id,
// account_id: t.acct,
// amount: t.amount,
// payee_id: payee ? payee.id : null,
// payee: payee ? payee.name : null,
// imported_payee: t.imported_description,
// category_id: t.category,
// date: t.date,
// notes: t.notes,
// imported_id: t.financial_id,
// transfer_id: t.transferred_id,
// cleared: t.cleared
// };
// }

// let splits = getAllSplitTransactions(transactions, idx);
// if (splits) {
// let payee =
// splits.parent.description && payees[splits.parent.description];

// return {
// ...convert(splits.parent, payee),
// subtransactions: splits.children.map(child => convert(child, payee))
// };
// }

// let transaction = transactions[idx];
// let payee = transaction.description && payees[transaction.description];
// return convert(transaction, payee);
},

fromExternal(transaction) {
let result: Record<string, unknown> = {};
if ('id' in transaction) {
result.id = transaction.id;
}
if ('account_id' in transaction) {
result.acct = transaction.account_id;
}
if ('amount' in transaction) {
result.amount = transaction.amount;
}
if ('payee_id' in transaction) {
result.description = transaction.payee_id;
}
if ('imported_payee' in transaction) {
result.imported_description = transaction.imported_payee;
}
if ('category_id' in transaction) {
result.category = transaction.category_id;
}
if ('date' in transaction) {
result.date = transaction.date;
}
if ('notes' in transaction) {
result.notes = transaction.notes;
}
if ('imported_id' in transaction) {
result.financial_id = transaction.imported_id;
}
if ('transfer_id' in transaction) {
result.transferred_id = transaction.transfer_id;
}
if ('cleared' in transaction) {
result.cleared = transaction.cleared;
}
return result;
},
};

export const accountModel = {
...models.accountModel,

Expand Down
4 changes: 0 additions & 4 deletions packages/loot-core/src/server/aql/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,3 @@ export function generateSQLWithState(
let { sqlPieces, state } = compileQuery(queryState, schema, schemaConfig);
return { sql: defaultConstructQuery(queryState, state, sqlPieces), state };
}

export function generateSQL(queryState) {
return generateSQLWithState(queryState).sql;
}
4 changes: 0 additions & 4 deletions packages/loot-core/src/server/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,3 @@ export function FileDownloadError(reason, meta?) {
export function FileUploadError(reason, meta?) {
return { type: 'FileUploadError', reason, meta };
}

export function isCodeError(err) {
return err instanceof ReferenceError || err instanceof SyntaxError;
}
59 changes: 0 additions & 59 deletions packages/loot-core/src/server/perf.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/loot-core/src/server/spreadsheet/globals.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
export function first(arr) {
return arr[0];
}

export function firstValue(arr) {
const keys = Object.keys(arr[0]);
return arr[0][keys[0]];
}

export function number(v) {
if (typeof v === 'number') {
return v;
Expand All @@ -20,11 +11,3 @@ export function number(v) {

return 0;
}

export function min(x, y) {
return Math.min(x, y);
}

export function max(x, y) {
return Math.max(x, y);
}
Loading

0 comments on commit 0c0f9e6

Please sign in to comment.