Skip to content

Commit

Permalink
fix(tabstractdatabase): fix registerPlugins methods forof loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Itee committed Aug 12, 2019
1 parent dd7c536 commit 2e210a3
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions sources/core/databases/TAbstractDatabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,19 @@ class TAbstractDatabase {

_registerPlugins () {

for ( let [ name, config ] of Object.entries(this._plugins) ) {
for ( let [ name, config ] of Object.entries( this._plugins ) ) {

}

for ( let pluginName in this._plugins ) {

if ( !Object.prototype.hasOwnProperty.call( this._plugins, pluginName ) ) { continue }

const pluginConfig = this._plugins[ pluginName ]

if ( this._registerPackagePlugin( pluginName, pluginConfig ) ) {
if ( this._registerPackagePlugin( name, config ) ) {

console.log( `Use ${pluginName} plugin from node_modules` )
console.log( `Use ${name} plugin from node_modules` )

} else if ( this._registerLocalPlugin( pluginName, pluginConfig ) ) {
} else if ( this._registerLocalPlugin( name, config ) ) {

console.log( `Use ${pluginName} plugin from local folder` )
console.log( `Use ${name} plugin from local folder` )

} else {

console.error( `Unable to register the plugin ${pluginPath} the package or local folder doesn't seem to exist ! Skip it.` )
console.error( `Unable to register the plugin ${name} the package or local folder doesn't seem to exist ! Skip it.` )

}

Expand Down

0 comments on commit 2e210a3

Please sign in to comment.