Skip to content

Commit

Permalink
refactor: remove unwanted difference utility method
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 12, 2020
1 parent 10b3af1 commit db67faf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion providers/DatabaseProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit db67faf

Please sign in to comment.