From db67faffc03da6bbe4babf4f99d67edc6fec8651 Mon Sep 17 00:00:00 2001 From: Harminder virk Date: Sun, 12 Jan 2020 10:38:20 +0530 Subject: [PATCH] refactor: remove unwanted `difference` utility method --- providers/DatabaseProvider.ts | 2 +- src/utils/index.ts | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/providers/DatabaseProvider.ts b/providers/DatabaseProvider.ts index 4d48b1f7..70e7d1ea 100644 --- a/providers/DatabaseProvider.ts +++ b/providers/DatabaseProvider.ts @@ -41,7 +41,7 @@ export default class DatabaseServiceProvider { }) this.$container.singleton('Adonis/Lucid/Orm', () => { - const config = this.$container.use('Adonis/Core/Config').get('database.ormConfig', {}) + const config = this.$container.use('Adonis/Core/Config').get('database.orm', {}) /** * Attaching adapter to the base model. Each model is allowed to define diff --git a/src/utils/index.ts b/src/utils/index.ts index f150aabe..8325f881 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -90,18 +90,6 @@ export function unique (value: any[]) { return [...new Set(value)] } -/** - * Finds the diff between 2 arrays - */ -export function difference (main: any[], other: []) { - return [main, other].reduce((a, b) => { - return a.filter(c => { - /* eslint-disable-next-line eqeqeq */ - return !b.find((one) => c == one) - }) - }) -} - /** * Returns a diff of rows to be updated or inserted when performing * a many to many `attach`