@lskjs/module
Advanced tools
Comparing version 2.43.0 to 2.46.0
@@ -14,9 +14,12 @@ import { IModule, IModuleConstructor, IModuleLifecycle, IModuleProps, IModuleWithLifecycle } from './types'; | ||
__init(): Promise<void>; | ||
_init(): Promise<void>; | ||
init(): Promise<void>; | ||
start(): Promise<void>; | ||
__run(): Promise<void>; | ||
_run(): Promise<void>; | ||
run(): Promise<void>; | ||
__stop(): Promise<void>; | ||
_stop(): Promise<void>; | ||
stop(): Promise<void>; | ||
} | ||
export default ModuleWithLifecycle; |
@@ -115,3 +115,3 @@ "use strict"; | ||
value: function () { | ||
var _init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() { | ||
var _init2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() { | ||
var name; | ||
@@ -146,39 +146,28 @@ return _regenerator["default"].wrap(function _callee3$(_context3) { | ||
_context3.prev = 6; | ||
_context3.next = 9; | ||
return this.init(); | ||
_context3.next = 8; | ||
return this._init(); | ||
case 9: | ||
_context3.next = 15; | ||
break; | ||
case 11: | ||
_context3.prev = 11; | ||
_context3.t0 = _context3["catch"](6); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'init()', _context3.t0); | ||
throw _context3.t0; | ||
case 15: | ||
case 8: | ||
this.__lifecycleEvent('initFinish'); | ||
if (!this.onInit) { | ||
_context3.next = 26; | ||
_context3.next = 19; | ||
break; | ||
} | ||
_context3.prev = 17; | ||
_context3.next = 20; | ||
_context3.prev = 10; | ||
_context3.next = 13; | ||
return this.onInit(); | ||
case 20: | ||
_context3.next = 26; | ||
case 13: | ||
_context3.next = 19; | ||
break; | ||
case 22: | ||
_context3.prev = 22; | ||
_context3.t1 = _context3["catch"](17); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'onInit()', _context3.t1); | ||
throw _context3.t1; | ||
case 15: | ||
_context3.prev = 15; | ||
_context3.t0 = _context3["catch"](10); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'onInit()', _context3.t0); | ||
throw _context3.t0; | ||
case 26: | ||
case 19: | ||
case "end": | ||
@@ -188,7 +177,7 @@ return _context3.stop(); | ||
} | ||
}, _callee3, this, [[6, 11], [17, 22]]); | ||
}, _callee3, this, [[10, 15]]); | ||
})); | ||
function __init() { | ||
return _init.apply(this, arguments); | ||
return _init2.apply(this, arguments); | ||
} | ||
@@ -199,5 +188,5 @@ | ||
}, { | ||
key: "init", | ||
key: "_init", | ||
value: function () { | ||
var _init2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() { | ||
var _init3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() { | ||
var name; | ||
@@ -235,4 +224,17 @@ return _regenerator["default"].wrap(function _callee4$(_context4) { | ||
this.name = name; | ||
_context4.prev = 6; | ||
_context4.next = 9; | ||
return this.init(); | ||
case 6: | ||
case 9: | ||
_context4.next = 15; | ||
break; | ||
case 11: | ||
_context4.prev = 11; | ||
_context4.t0 = _context4["catch"](6); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'init()', _context4.t0); | ||
throw _context4.t0; | ||
case 15: | ||
case "end": | ||
@@ -242,7 +244,28 @@ return _context4.stop(); | ||
} | ||
}, _callee4, this); | ||
}, _callee4, this, [[6, 11]]); | ||
})); | ||
function _init() { | ||
return _init3.apply(this, arguments); | ||
} | ||
return _init; | ||
}() | ||
}, { | ||
key: "init", | ||
value: function () { | ||
var _init4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() { | ||
return _regenerator["default"].wrap(function _callee5$(_context5) { | ||
while (1) { | ||
switch (_context5.prev = _context5.next) { | ||
case 0: | ||
case "end": | ||
return _context5.stop(); | ||
} | ||
} | ||
}, _callee5); | ||
})); | ||
function init() { | ||
return _init2.apply(this, arguments); | ||
return _init4.apply(this, arguments); | ||
} | ||
@@ -255,8 +278,8 @@ | ||
value: function () { | ||
var _start = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() { | ||
return _regenerator["default"].wrap(function _callee5$(_context5) { | ||
var _start = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() { | ||
return _regenerator["default"].wrap(function _callee6$(_context6) { | ||
while (1) { | ||
switch (_context5.prev = _context5.next) { | ||
switch (_context6.prev = _context6.next) { | ||
case 0: | ||
_context5.next = 2; | ||
_context6.next = 2; | ||
return this.__run(); | ||
@@ -266,6 +289,6 @@ | ||
case "end": | ||
return _context5.stop(); | ||
return _context6.stop(); | ||
} | ||
} | ||
}, _callee5, this); | ||
}, _callee6, this); | ||
})); | ||
@@ -282,6 +305,6 @@ | ||
value: function () { | ||
var _run = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() { | ||
return _regenerator["default"].wrap(function _callee6$(_context6) { | ||
var _run2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() { | ||
return _regenerator["default"].wrap(function _callee7$(_context7) { | ||
while (1) { | ||
switch (_context6.prev = _context6.next) { | ||
switch (_context7.prev = _context7.next) { | ||
case 0: | ||
@@ -296,3 +319,3 @@ if (this.__lifecycle.runStart && this.__lifecycle.stopFinish) { | ||
if (!this.__lifecycle.runStart) { | ||
_context6.next = 5; | ||
_context7.next = 5; | ||
break; | ||
@@ -302,3 +325,3 @@ } | ||
if (!STRICT_DEBUG) { | ||
_context6.next = 4; | ||
_context7.next = 4; | ||
break; | ||
@@ -314,11 +337,11 @@ } | ||
case 4: | ||
return _context6.abrupt("return"); | ||
return _context7.abrupt("return"); | ||
case 5: | ||
if (this.__lifecycle.initStart) { | ||
_context6.next = 8; | ||
_context7.next = 8; | ||
break; | ||
} | ||
_context6.next = 8; | ||
_context7.next = 8; | ||
return this.__init(); | ||
@@ -328,3 +351,3 @@ | ||
if (this.__lifecycle.initFinish) { | ||
_context6.next = 10; | ||
_context7.next = 10; | ||
break; | ||
@@ -342,29 +365,18 @@ } | ||
_context6.prev = 11; | ||
_context6.next = 14; | ||
return this.run(); | ||
_context7.next = 13; | ||
return this._run(); | ||
case 14: | ||
_context6.next = 20; | ||
break; | ||
case 16: | ||
_context6.prev = 16; | ||
_context6.t0 = _context6["catch"](11); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'run()', _context6.t0); | ||
throw _context6.t0; | ||
case 20: | ||
case 13: | ||
this.__lifecycleEvent('runFinish'); | ||
case 21: | ||
case 14: | ||
case "end": | ||
return _context6.stop(); | ||
return _context7.stop(); | ||
} | ||
} | ||
}, _callee6, this, [[11, 16]]); | ||
}, _callee7, this); | ||
})); | ||
function __run() { | ||
return _run.apply(this, arguments); | ||
return _run2.apply(this, arguments); | ||
} | ||
@@ -375,11 +387,11 @@ | ||
}, { | ||
key: "run", | ||
key: "_run", | ||
value: function () { | ||
var _run2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() { | ||
return _regenerator["default"].wrap(function _callee7$(_context7) { | ||
var _run3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() { | ||
return _regenerator["default"].wrap(function _callee8$(_context8) { | ||
while (1) { | ||
switch (_context7.prev = _context7.next) { | ||
switch (_context8.prev = _context8.next) { | ||
case 0: | ||
if (this.__lifecycle.runStart) { | ||
_context7.next = 2; | ||
_context8.next = 2; | ||
break; | ||
@@ -395,11 +407,47 @@ } | ||
case 2: | ||
_context8.prev = 2; | ||
_context8.next = 5; | ||
return this.run(); | ||
case 5: | ||
_context8.next = 11; | ||
break; | ||
case 7: | ||
_context8.prev = 7; | ||
_context8.t0 = _context8["catch"](2); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'run()', _context8.t0); | ||
throw _context8.t0; | ||
case 11: | ||
case "end": | ||
return _context7.stop(); | ||
return _context8.stop(); | ||
} | ||
} | ||
}, _callee7, this); | ||
}, _callee8, this, [[2, 7]]); | ||
})); | ||
function _run() { | ||
return _run3.apply(this, arguments); | ||
} | ||
return _run; | ||
}() | ||
}, { | ||
key: "run", | ||
value: function () { | ||
var _run4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() { | ||
return _regenerator["default"].wrap(function _callee9$(_context9) { | ||
while (1) { | ||
switch (_context9.prev = _context9.next) { | ||
case 0: | ||
case "end": | ||
return _context9.stop(); | ||
} | ||
} | ||
}, _callee9); | ||
})); | ||
function run() { | ||
return _run2.apply(this, arguments); | ||
return _run4.apply(this, arguments); | ||
} | ||
@@ -412,9 +460,9 @@ | ||
value: function () { | ||
var _stop = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() { | ||
return _regenerator["default"].wrap(function _callee8$(_context8) { | ||
var _stop2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() { | ||
return _regenerator["default"].wrap(function _callee10$(_context10) { | ||
while (1) { | ||
switch (_context8.prev = _context8.next) { | ||
switch (_context10.prev = _context10.next) { | ||
case 0: | ||
if (!this.__lifecycle.stopStart) { | ||
_context8.next = 4; | ||
_context10.next = 4; | ||
break; | ||
@@ -424,3 +472,3 @@ } | ||
if (!STRICT_DEBUG) { | ||
_context8.next = 3; | ||
_context10.next = 3; | ||
break; | ||
@@ -432,7 +480,7 @@ } | ||
case 3: | ||
return _context8.abrupt("return"); | ||
return _context10.abrupt("return"); | ||
case 4: | ||
if (this.__lifecycle.runStart) { | ||
_context8.next = 8; | ||
_context10.next = 8; | ||
break; | ||
@@ -442,3 +490,3 @@ } | ||
if (!STRICT_DEBUG) { | ||
_context8.next = 7; | ||
_context10.next = 7; | ||
break; | ||
@@ -450,3 +498,3 @@ } | ||
case 7: | ||
return _context8.abrupt("return"); | ||
return _context10.abrupt("return"); | ||
@@ -456,29 +504,18 @@ case 8: | ||
_context8.prev = 9; | ||
_context8.next = 12; | ||
return this.stop(); | ||
_context10.next = 11; | ||
return this._stop(); | ||
case 12: | ||
_context8.next = 18; | ||
break; | ||
case 14: | ||
_context8.prev = 14; | ||
_context8.t0 = _context8["catch"](9); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'stop()', _context8.t0); | ||
throw _context8.t0; | ||
case 18: | ||
case 11: | ||
this.__lifecycleEvent('stopFinish'); | ||
case 19: | ||
case 12: | ||
case "end": | ||
return _context8.stop(); | ||
return _context10.stop(); | ||
} | ||
} | ||
}, _callee8, this, [[9, 14]]); | ||
}, _callee10, this); | ||
})); | ||
function __stop() { | ||
return _stop.apply(this, arguments); | ||
return _stop2.apply(this, arguments); | ||
} | ||
@@ -489,11 +526,11 @@ | ||
}, { | ||
key: "stop", | ||
key: "_stop", | ||
value: function () { | ||
var _stop2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() { | ||
return _regenerator["default"].wrap(function _callee9$(_context9) { | ||
var _stop3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() { | ||
return _regenerator["default"].wrap(function _callee11$(_context11) { | ||
while (1) { | ||
switch (_context9.prev = _context9.next) { | ||
switch (_context11.prev = _context11.next) { | ||
case 0: | ||
if (this.__lifecycle.stopStart) { | ||
_context9.next = 2; | ||
_context11.next = 2; | ||
break; | ||
@@ -509,11 +546,47 @@ } | ||
case 2: | ||
_context11.prev = 2; | ||
_context11.next = 5; | ||
return this.stop(); | ||
case 5: | ||
_context11.next = 11; | ||
break; | ||
case 7: | ||
_context11.prev = 7; | ||
_context11.t0 = _context11["catch"](2); | ||
(0, _safeLog.safeLog)(this, 'fatal', 'stop()', _context11.t0); | ||
throw _context11.t0; | ||
case 11: | ||
case "end": | ||
return _context9.stop(); | ||
return _context11.stop(); | ||
} | ||
} | ||
}, _callee9, this); | ||
}, _callee11, this, [[2, 7]]); | ||
})); | ||
function _stop() { | ||
return _stop3.apply(this, arguments); | ||
} | ||
return _stop; | ||
}() | ||
}, { | ||
key: "stop", | ||
value: function () { | ||
var _stop4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() { | ||
return _regenerator["default"].wrap(function _callee12$(_context12) { | ||
while (1) { | ||
switch (_context12.prev = _context12.next) { | ||
case 0: | ||
case "end": | ||
return _context12.stop(); | ||
} | ||
} | ||
}, _callee12); | ||
})); | ||
function stop() { | ||
return _stop2.apply(this, arguments); | ||
return _stop4.apply(this, arguments); | ||
} | ||
@@ -540,3 +613,3 @@ | ||
value: function () { | ||
var _create = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() { | ||
var _create = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() { | ||
var instance, | ||
@@ -546,12 +619,12 @@ _len3, | ||
_key3, | ||
_args10 = arguments; | ||
_args13 = arguments; | ||
return _regenerator["default"].wrap(function _callee10$(_context10) { | ||
return _regenerator["default"].wrap(function _callee13$(_context13) { | ||
while (1) { | ||
switch (_context10.prev = _context10.next) { | ||
switch (_context13.prev = _context13.next) { | ||
case 0: | ||
instance = new this(); | ||
for (_len3 = _args10.length, propsArray = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
propsArray[_key3] = _args10[_key3]; | ||
for (_len3 = _args13.length, propsArray = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
propsArray[_key3] = _args13[_key3]; | ||
} | ||
@@ -564,11 +637,11 @@ | ||
if (!instance.__init) { | ||
_context10.next = 8; | ||
_context13.next = 8; | ||
break; | ||
} | ||
_context10.next = 6; | ||
_context13.next = 6; | ||
return instance.__init(); | ||
case 6: | ||
_context10.next = 11; | ||
_context13.next = 11; | ||
break; | ||
@@ -578,18 +651,18 @@ | ||
if (!instance.init) { | ||
_context10.next = 11; | ||
_context13.next = 11; | ||
break; | ||
} | ||
_context10.next = 11; | ||
_context13.next = 11; | ||
return instance.init(); | ||
case 11: | ||
return _context10.abrupt("return", instance); | ||
return _context13.abrupt("return", instance); | ||
case 12: | ||
case "end": | ||
return _context10.stop(); | ||
return _context13.stop(); | ||
} | ||
} | ||
}, _callee10, this); | ||
}, _callee13, this); | ||
})); | ||
@@ -606,16 +679,16 @@ | ||
value: function () { | ||
var _createAndRun = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() { | ||
var _args11 = arguments; | ||
return _regenerator["default"].wrap(function _callee11$(_context11) { | ||
var _createAndRun = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() { | ||
var _args14 = arguments; | ||
return _regenerator["default"].wrap(function _callee14$(_context14) { | ||
while (1) { | ||
switch (_context11.prev = _context11.next) { | ||
switch (_context14.prev = _context14.next) { | ||
case 0: | ||
return _context11.abrupt("return", this.start.apply(this, _args11)); | ||
return _context14.abrupt("return", this.start.apply(this, _args14)); | ||
case 1: | ||
case "end": | ||
return _context11.stop(); | ||
return _context14.stop(); | ||
} | ||
} | ||
}, _callee11, this); | ||
}, _callee14, this); | ||
})); | ||
@@ -632,25 +705,25 @@ | ||
value: function () { | ||
var _start2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() { | ||
var _start2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() { | ||
var instance, | ||
_args12 = arguments; | ||
return _regenerator["default"].wrap(function _callee12$(_context12) { | ||
_args15 = arguments; | ||
return _regenerator["default"].wrap(function _callee15$(_context15) { | ||
while (1) { | ||
switch (_context12.prev = _context12.next) { | ||
switch (_context15.prev = _context15.next) { | ||
case 0: | ||
_context12.next = 2; | ||
return this.create.apply(this, _args12); | ||
_context15.next = 2; | ||
return this.create.apply(this, _args15); | ||
case 2: | ||
instance = _context12.sent; | ||
instance = _context15.sent; | ||
if (!instance.start) { | ||
_context12.next = 8; | ||
_context15.next = 8; | ||
break; | ||
} | ||
_context12.next = 6; | ||
_context15.next = 6; | ||
return instance.start(); | ||
case 6: | ||
_context12.next = 16; | ||
_context15.next = 16; | ||
break; | ||
@@ -660,11 +733,11 @@ | ||
if (!instance.__run) { | ||
_context12.next = 13; | ||
_context15.next = 13; | ||
break; | ||
} | ||
_context12.next = 11; | ||
_context15.next = 11; | ||
return instance.__run(); | ||
case 11: | ||
_context12.next = 16; | ||
_context15.next = 16; | ||
break; | ||
@@ -674,18 +747,18 @@ | ||
if (!instance.run) { | ||
_context12.next = 16; | ||
_context15.next = 16; | ||
break; | ||
} | ||
_context12.next = 16; | ||
_context15.next = 16; | ||
return instance.run(); | ||
case 16: | ||
return _context12.abrupt("return", instance); | ||
return _context15.abrupt("return", instance); | ||
case 17: | ||
case "end": | ||
return _context12.stop(); | ||
return _context15.stop(); | ||
} | ||
} | ||
}, _callee12, this); | ||
}, _callee15, this); | ||
})); | ||
@@ -692,0 +765,0 @@ |
{ | ||
"name": "@lskjs/module", | ||
"version": "2.43.0", | ||
"version": "2.46.0", | ||
"description": "Module system with dependency injection, event emitter, logger and submodules tree", | ||
@@ -53,3 +53,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "b45278be2c9d8a4433504d02c970779d72db6c58" | ||
"gitHead": "f5f432f37b5e4fd9e5844a48d402103a99585cfa" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
229418
3273