HowProgrammingWorks / NodejsStarterKit

Starter Kit for Node.js 16 or later, minimum dependencies 🚀
http://metarhia.com
MIT License
462 stars 102 forks source link

Bug: critical error in `Application.loadModule` #197

Open georgolden opened 3 years ago

georgolden commented 3 years ago

Application.loadModule method loads module trees wrong. Logs Application.sandbox.lib:

2021-09-08T10:04:10     {
  example: [Function: bound method] {
    cache: { set: [Function: bound set], get: [Function: bound get] },
    doSomething: [Function: bound ],
    start: [Function: bound method] AsyncFunction,
    stop: [Function: bound ] AsyncFunction,
    storage: [Function: bound method],
    submodule1: [Function: bound ] { method2: [Function: bound ] },
    submodule2: [Function: bound ] {
      method2: [Function: bound ],
      nested1: [Function: bound ]
    },
    submodule3: [Function: bound ]
  },
  pg: [Function: bound Database] {
    constants: {},
    updates: [Function: bound ],
    where: [Function: bound ]
  },
  resmon: [Function: bound ] { start: [Function: bound ] AsyncFunction },
  utils: [Function: bound ]
}

This happens because submodule case partially ignored in current implementation