@leyyo/common 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/index.d.ts +3 -0
- package/dist/base/index.js +20 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/index.types.d.ts +196 -0
- package/dist/{type/index.js → base/index.types.js} +2 -3
- package/dist/base/index.types.js.map +1 -0
- package/dist/base/leyyo.d.ts +5 -0
- package/dist/base/leyyo.js +85 -0
- package/dist/base/leyyo.js.map +1 -0
- package/dist/base/leyyo.types.d.ts +18 -0
- package/dist/base/leyyo.types.js +3 -0
- package/dist/base/leyyo.types.js.map +1 -0
- package/dist/class/index.d.ts +1 -1
- package/dist/class/index.js +1 -1
- package/dist/class/index.js.map +1 -1
- package/dist/class/index.types.d.ts +30 -0
- package/dist/class/index.types.js +3 -0
- package/dist/class/index.types.js.map +1 -0
- package/dist/class/list.d.ts +1 -1
- package/dist/class/logger.instance.d.ts +14 -10
- package/dist/class/logger.instance.js +34 -72
- package/dist/class/logger.instance.js.map +1 -1
- package/dist/common/deploy.common.d.ts +26 -0
- package/dist/common/deploy.common.js +74 -0
- package/dist/common/deploy.common.js.map +1 -0
- package/dist/common/enum.pool.d.ts +23 -0
- package/dist/common/enum.pool.js +100 -0
- package/dist/common/enum.pool.js.map +1 -0
- package/dist/common/error.common.d.ts +48 -0
- package/dist/common/error.common.js +328 -0
- package/dist/common/error.common.js.map +1 -0
- package/dist/common/error.pool.d.ts +20 -0
- package/dist/common/error.pool.js +54 -0
- package/dist/common/error.pool.js.map +1 -0
- package/dist/common/event.common.d.ts +24 -0
- package/dist/common/event.common.js +135 -0
- package/dist/common/event.common.js.map +1 -0
- package/dist/common/index.d.ts +11 -17
- package/dist/common/index.js +11 -17
- package/dist/common/index.js.map +1 -1
- package/dist/common/index.types.d.ts +561 -0
- package/dist/common/index.types.js +4 -0
- package/dist/common/index.types.js.map +1 -0
- package/dist/common/inert.d.ts +74 -0
- package/dist/common/inert.js +302 -0
- package/dist/common/inert.js.map +1 -0
- package/dist/common/lifecycle.common.d.ts +26 -0
- package/dist/common/lifecycle.common.js +124 -0
- package/dist/common/lifecycle.common.js.map +1 -0
- package/dist/common/literal.pool.d.ts +23 -0
- package/dist/common/literal.pool.js +100 -0
- package/dist/common/literal.pool.js.map +1 -0
- package/dist/common/log.common.d.ts +81 -0
- package/dist/common/log.common.js +375 -0
- package/dist/common/log.common.js.map +1 -0
- package/dist/common/repo.common.d.ts +225 -0
- package/dist/common/repo.common.js +474 -0
- package/dist/common/repo.common.js.map +1 -0
- package/dist/const/index.d.ts +24 -19
- package/dist/const/index.js +25 -20
- package/dist/const/index.js.map +1 -1
- package/dist/error/caused.error.d.ts +1 -1
- package/dist/error/developer.error.d.ts +7 -7
- package/dist/error/developer.error.js +11 -29
- package/dist/error/developer.error.js.map +1 -1
- package/dist/error/http.error.d.ts +1 -1
- package/dist/error/http.error.js +3 -3
- package/dist/error/http.error.js.map +1 -1
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.js +1 -0
- package/dist/error/index.js.map +1 -1
- package/dist/error/index.types.d.ts +195 -0
- package/dist/error/index.types.js +3 -0
- package/dist/error/index.types.js.map +1 -0
- package/dist/error/invalid-value.error.js +1 -1
- package/dist/error/invalid-value.error.js.map +1 -1
- package/dist/error/leyyo.error.d.ts +9 -5
- package/dist/error/leyyo.error.js +37 -32
- package/dist/error/leyyo.error.js.map +1 -1
- package/dist/error/multiple.error.d.ts +1 -1
- package/dist/error/multiple.error.js.map +1 -1
- package/dist/function/define-loader.d.ts +8 -0
- package/dist/function/define-loader.js +23 -0
- package/dist/function/define-loader.js.map +1 -0
- package/dist/function/delete-prop.d.ts +24 -0
- package/dist/function/delete-prop.js +76 -0
- package/dist/function/delete-prop.js.map +1 -0
- package/dist/function/empty.fn.d.ts +1 -2
- package/dist/function/empty.fn.js.map +1 -1
- package/dist/function/extended-type.d.ts +1 -1
- package/dist/function/extended-type.js +8 -5
- package/dist/function/extended-type.js.map +1 -1
- package/dist/function/get-fqn.d.ts +8 -0
- package/dist/function/get-fqn.js +33 -0
- package/dist/function/get-fqn.js.map +1 -0
- package/dist/function/get-prop.d.ts +24 -0
- package/dist/function/get-prop.js +63 -0
- package/dist/function/get-prop.js.map +1 -0
- package/dist/function/has-fqn.d.ts +8 -0
- package/dist/function/has-fqn.js +32 -0
- package/dist/function/has-fqn.js.map +1 -0
- package/dist/function/index.d.ts +21 -3
- package/dist/function/index.js +21 -3
- package/dist/function/index.js.map +1 -1
- package/dist/function/index.types.d.ts +35 -0
- package/dist/function/index.types.js +4 -0
- package/dist/function/index.types.js.map +1 -0
- package/dist/function/is-anonymous-name.d.ts +1 -0
- package/dist/function/is-anonymous-name.js +11 -0
- package/dist/function/is-anonymous-name.js.map +1 -0
- package/dist/function/is-test.d.ts +10 -0
- package/dist/function/is-test.js +37 -0
- package/dist/function/is-test.js.map +1 -0
- package/dist/function/{is.js → is.fn.js} +1 -1
- package/dist/function/is.fn.js.map +1 -0
- package/dist/function/leyyo-fn.d.ts +3 -0
- package/dist/function/leyyo-fn.js +14 -0
- package/dist/function/leyyo-fn.js.map +1 -0
- package/dist/function/on-fqn-set.d.ts +2 -0
- package/dist/function/on-fqn-set.js +40 -0
- package/dist/function/on-fqn-set.js.map +1 -0
- package/dist/function/one-or-more.d.ts +1 -1
- package/dist/{common → function}/opt.fn.d.ts +2 -1
- package/dist/{common → function}/opt.fn.js +15 -10
- package/dist/function/opt.fn.js.map +1 -0
- package/dist/function/random-test-no.d.ts +6 -0
- package/dist/function/random-test-no.js +12 -0
- package/dist/function/random-test-no.js.map +1 -0
- package/dist/function/remove-fqn.d.ts +10 -0
- package/dist/function/remove-fqn.js +44 -0
- package/dist/function/remove-fqn.js.map +1 -0
- package/dist/{common/exporter.fn.d.ts → function/run-exporter.d.ts} +1 -1
- package/dist/{common/exporter.fn.js → function/run-exporter.js} +7 -3
- package/dist/function/run-exporter.js.map +1 -0
- package/dist/function/secure-clone.d.ts +1 -1
- package/dist/function/set-anonymous-fqn.d.ts +2 -0
- package/dist/function/set-anonymous-fqn.js +44 -0
- package/dist/function/set-anonymous-fqn.js.map +1 -0
- package/dist/function/set-anonymous-name.d.ts +2 -0
- package/dist/function/set-anonymous-name.js +66 -0
- package/dist/function/set-anonymous-name.js.map +1 -0
- package/dist/function/set-fqn.d.ts +9 -0
- package/dist/function/set-fqn.js +69 -0
- package/dist/function/set-fqn.js.map +1 -0
- package/dist/function/set-prop.d.ts +27 -0
- package/dist/function/set-prop.js +71 -0
- package/dist/function/set-prop.js.map +1 -0
- package/dist/function/stamp-loader.d.ts +8 -0
- package/dist/function/stamp-loader.js +18 -0
- package/dist/function/stamp-loader.js.map +1 -0
- package/dist/function/test-case.d.ts +8 -0
- package/dist/function/test-case.js +27 -0
- package/dist/function/test-case.js.map +1 -0
- package/dist/function/test-name.d.ts +8 -0
- package/dist/function/test-name.js +18 -0
- package/dist/function/test-name.js.map +1 -0
- package/dist/function/trigger-fqn.d.ts +2 -0
- package/dist/function/trigger-fqn.js +25 -0
- package/dist/function/trigger-fqn.js.map +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.foretell.js +8 -8
- package/dist/index.foretell.js.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.loader.d.ts +1 -1
- package/dist/index.loader.js +3 -3
- package/dist/index.loader.js.map +1 -1
- package/dist/init/index.d.ts +1 -1
- package/dist/init/index.js +4 -3
- package/dist/init/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/common/array.fn.d.ts +0 -46
- package/dist/common/array.fn.js +0 -131
- package/dist/common/array.fn.js.map +0 -1
- package/dist/common/deploy.fn.d.ts +0 -18
- package/dist/common/deploy.fn.js +0 -74
- package/dist/common/deploy.fn.js.map +0 -1
- package/dist/common/enum.fn.d.ts +0 -48
- package/dist/common/enum.fn.js +0 -133
- package/dist/common/enum.fn.js.map +0 -1
- package/dist/common/error.fn.d.ts +0 -100
- package/dist/common/error.fn.js +0 -401
- package/dist/common/error.fn.js.map +0 -1
- package/dist/common/event.fn.d.ts +0 -45
- package/dist/common/event.fn.js +0 -161
- package/dist/common/event.fn.js.map +0 -1
- package/dist/common/exporter.fn.js.map +0 -1
- package/dist/common/fqn.fn.d.ts +0 -31
- package/dist/common/fqn.fn.js +0 -197
- package/dist/common/fqn.fn.js.map +0 -1
- package/dist/common/inert.fn.d.ts +0 -69
- package/dist/common/inert.fn.js +0 -368
- package/dist/common/inert.fn.js.map +0 -1
- package/dist/common/lifecycle.fn.d.ts +0 -24
- package/dist/common/lifecycle.fn.js +0 -136
- package/dist/common/lifecycle.fn.js.map +0 -1
- package/dist/common/list.fn.d.ts +0 -47
- package/dist/common/list.fn.js +0 -132
- package/dist/common/list.fn.js.map +0 -1
- package/dist/common/loader.fn.d.ts +0 -15
- package/dist/common/loader.fn.js +0 -38
- package/dist/common/loader.fn.js.map +0 -1
- package/dist/common/log.fn.d.ts +0 -42
- package/dist/common/log.fn.js +0 -333
- package/dist/common/log.fn.js.map +0 -1
- package/dist/common/map.fn.d.ts +0 -46
- package/dist/common/map.fn.js +0 -131
- package/dist/common/map.fn.js.map +0 -1
- package/dist/common/name.fn.d.ts +0 -5
- package/dist/common/name.fn.js +0 -69
- package/dist/common/name.fn.js.map +0 -1
- package/dist/common/opt.fn.js.map +0 -1
- package/dist/common/set.fn.d.ts +0 -46
- package/dist/common/set.fn.js +0 -131
- package/dist/common/set.fn.js.map +0 -1
- package/dist/common/test.fn.d.ts +0 -26
- package/dist/common/test.fn.js +0 -81
- package/dist/common/test.fn.js.map +0 -1
- package/dist/function/error-obj.d.ts +0 -8
- package/dist/function/error-obj.js +0 -25
- package/dist/function/error-obj.js.map +0 -1
- package/dist/function/error-text.d.ts +0 -10
- package/dist/function/error-text.js +0 -43
- package/dist/function/error-text.js.map +0 -1
- package/dist/function/is.js.map +0 -1
- package/dist/type/index.d.ts +0 -551
- package/dist/type/index.js.map +0 -1
- /package/dist/function/{is.d.ts → is.fn.d.ts} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ErrorPool = void 0;
|
|
13
|
+
const inert_1 = require("./inert");
|
|
14
|
+
const function_1 = require("../function");
|
|
15
|
+
// noinspection JSUnusedGlobalSymbols
|
|
16
|
+
/**
|
|
17
|
+
* Error pool for call with name and lazy loading
|
|
18
|
+
* */
|
|
19
|
+
class ErrorPool extends inert_1.Inert {
|
|
20
|
+
constructor(leyyo) {
|
|
21
|
+
super(leyyo, 'error', { anonymousName: 'Error' });
|
|
22
|
+
this.leyyo = leyyo;
|
|
23
|
+
}
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
_getName(target) {
|
|
26
|
+
return target === null || target === void 0 ? void 0 : target.name;
|
|
27
|
+
}
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
_nextLoad(_item) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
_setName(target, _name) {
|
|
35
|
+
return target === null || target === void 0 ? void 0 : target.name;
|
|
36
|
+
}
|
|
37
|
+
/** @inheritDoc */
|
|
38
|
+
_afterTargetFound(item) {
|
|
39
|
+
if (item.lazyTarget) {
|
|
40
|
+
delete item.lazyTarget;
|
|
41
|
+
}
|
|
42
|
+
this.leyyo.errorCommon.setConfigItem(item.target, {
|
|
43
|
+
message: item.message,
|
|
44
|
+
emit: item.emit,
|
|
45
|
+
i18n: item.i18n,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** @inheritDoc */
|
|
49
|
+
_validate(target) {
|
|
50
|
+
return (0, function_1.isClass)(target);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.ErrorPool = ErrorPool;
|
|
54
|
+
//# sourceMappingURL=error.pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.pool.js","sourceRoot":"","sources":["../../src/common/error.pool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA8B;AAG9B,0CAAoC;AAEpC,qCAAqC;AACrC;;KAEK;AACL,MAAa,SAAU,SAAQ,aAA6C;IAExE,YAAsB,KAAgB;QAClC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,EAAC,aAAa,EAAE,OAAO,EAAC,CAAC,CAAC;QAD9B,UAAK,GAAL,KAAK,CAAW;IAEtC,CAAC;IAED,kBAAkB;IACR,QAAQ,CAAC,MAAiB;QAChC,OAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;IACxB,CAAC;IAED,kBAAkB;IACF,SAAS,CAAC,KAAoB;;QAC9C,CAAC;KAAA;IAED,kBAAkB;IACR,QAAQ,CAAC,MAAiB,EAAE,KAAa;QAC/C,OAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;IACxB,CAAC;IAED,kBAAkB;IACR,iBAAiB,CAAC,IAAmB;QAC3C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE;YAC9C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC,CAAA;IACN,CAAC;IAED,kBAAkB;IACR,SAAS,CAAC,MAAiB;QACjC,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACJ;AApCD,8BAoCC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventCommonLike, EventType } from "./index.types";
|
|
2
|
+
import { Fnc, LeyyoLike } from "../base";
|
|
3
|
+
/**
|
|
4
|
+
* Event common interface
|
|
5
|
+
* */
|
|
6
|
+
export declare class EventCommon<T extends string> implements EventCommonLike<T> {
|
|
7
|
+
private leyyo;
|
|
8
|
+
private readonly _emitter;
|
|
9
|
+
private readonly _listenedEvents;
|
|
10
|
+
private readonly _waitingEvents;
|
|
11
|
+
private readonly _removedEvents;
|
|
12
|
+
private readonly _deactivatedEvents;
|
|
13
|
+
constructor(leyyo: LeyyoLike);
|
|
14
|
+
/** @inheritDoc */
|
|
15
|
+
fork<F extends string>(): EventCommonLike<T | F>;
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
emit(name: T, ...values: Array<unknown>): boolean;
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
listen<T extends string = string>(name: EventType | T, callback: Fnc): void;
|
|
20
|
+
/** @inheritDoc */
|
|
21
|
+
deactivate(name: string): boolean;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
activate(name: string): boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EventCommon = void 0;
|
|
7
|
+
const internal_1 = require("../internal");
|
|
8
|
+
const function_1 = require("../function");
|
|
9
|
+
const node_events_1 = __importDefault(require("node:events"));
|
|
10
|
+
const where = `${internal_1.FQN}.EventCommon`;
|
|
11
|
+
// noinspection JSUnusedGlobalSymbols
|
|
12
|
+
/**
|
|
13
|
+
* Event common interface
|
|
14
|
+
* */
|
|
15
|
+
class EventCommon {
|
|
16
|
+
constructor(leyyo) {
|
|
17
|
+
this.leyyo = leyyo;
|
|
18
|
+
this._emitter = new node_events_1.default();
|
|
19
|
+
this._listenedEvents = this.leyyo.repoCommon.newMap(`${where}.listenedEvents`);
|
|
20
|
+
this._waitingEvents = this.leyyo.repoCommon.newMap(`${where}.waitingEvents`);
|
|
21
|
+
this._removedEvents = this.leyyo.repoCommon.newMap(`${where}.removedEvents`);
|
|
22
|
+
this._deactivatedEvents = this.leyyo.repoCommon.newSet(`${where}.deactivatedEvents`);
|
|
23
|
+
}
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
fork() {
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
emit(name, ...values) {
|
|
30
|
+
if (!(0, function_1.isText)(name)) {
|
|
31
|
+
throw new this.leyyo.developerError('Invalid event name', (0, function_1.testCase)(internal_1.FQN, 130), where);
|
|
32
|
+
}
|
|
33
|
+
if (!this._emitter.emit(name, ...values)) {
|
|
34
|
+
// It is deactivated, no collect it anymore
|
|
35
|
+
if (this._deactivatedEvents.has(name)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
let item = this._waitingEvents.get(name);
|
|
39
|
+
if (!item) {
|
|
40
|
+
item = [];
|
|
41
|
+
this._waitingEvents.set(name, item);
|
|
42
|
+
}
|
|
43
|
+
else if (item.length > 10000) {
|
|
44
|
+
let parts = this._removedEvents.get(name);
|
|
45
|
+
if (parts === undefined) {
|
|
46
|
+
parts = [item.length, item.length + 1];
|
|
47
|
+
this.leyyo.logger.warn(`Removed message. name: ${name}, times: ${parts[1]}`, {
|
|
48
|
+
where,
|
|
49
|
+
eventName: name
|
|
50
|
+
});
|
|
51
|
+
item.shift();
|
|
52
|
+
this._removedEvents.set(name, parts);
|
|
53
|
+
}
|
|
54
|
+
else if (parts[0] >= 10000) {
|
|
55
|
+
// there are too many events, and there is no any listener, close it
|
|
56
|
+
if (parts[1] > 50000) {
|
|
57
|
+
this.deactivate(name);
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
// clear half of it
|
|
61
|
+
parts[0] = 5000;
|
|
62
|
+
item.splice(0, 5000);
|
|
63
|
+
parts[1]++; // increment emitted
|
|
64
|
+
this.leyyo.logger.warn(`Removed all messages. name: ${name}, times: ${parts[1]}`, {
|
|
65
|
+
where,
|
|
66
|
+
eventName: name
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
parts[1]++; // increment emitted
|
|
71
|
+
item.shift();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
item.push(values);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
/** @inheritDoc */
|
|
80
|
+
listen(name, callback) {
|
|
81
|
+
if (!(0, function_1.isText)(name)) {
|
|
82
|
+
throw new this.leyyo.developerError('Invalid event name', (0, function_1.testCase)(internal_1.FQN, 130), where);
|
|
83
|
+
}
|
|
84
|
+
if (typeof callback !== 'function') {
|
|
85
|
+
throw new this.leyyo.developerError(`Invalid listener callback [${name}]`, (0, function_1.testCase)(internal_1.FQN, 131), where);
|
|
86
|
+
}
|
|
87
|
+
const exists = this._listenedEvents.has(name);
|
|
88
|
+
if (exists) {
|
|
89
|
+
this._emitter.removeAllListeners(name);
|
|
90
|
+
}
|
|
91
|
+
this._emitter.on(name, callback);
|
|
92
|
+
// if there is a listener, event will be activated automatically
|
|
93
|
+
this.activate(name);
|
|
94
|
+
this._listenedEvents.set(name, callback);
|
|
95
|
+
if (!exists) {
|
|
96
|
+
if (this._waitingEvents.has(name)) {
|
|
97
|
+
this._waitingEvents.get(name).forEach(values => {
|
|
98
|
+
this._emitter.emit(name, ...values);
|
|
99
|
+
});
|
|
100
|
+
this._waitingEvents.delete(name);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** @inheritDoc */
|
|
105
|
+
deactivate(name) {
|
|
106
|
+
if (!(0, function_1.isText)(name)) {
|
|
107
|
+
throw new this.leyyo.developerError('Invalid event name', (0, function_1.testCase)(internal_1.FQN, 132), where);
|
|
108
|
+
}
|
|
109
|
+
if (this._waitingEvents.has(name)) {
|
|
110
|
+
this.leyyo.logger.warn(`Deactivated and cleared all messages. name: ${name}`, { where, eventName: name });
|
|
111
|
+
this._waitingEvents.delete(name);
|
|
112
|
+
}
|
|
113
|
+
if (this._removedEvents.has(name)) {
|
|
114
|
+
this._removedEvents.delete(name);
|
|
115
|
+
}
|
|
116
|
+
if (!this._deactivatedEvents.has(name)) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
this._deactivatedEvents.add(name);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
/** @inheritDoc */
|
|
123
|
+
activate(name) {
|
|
124
|
+
if (!(0, function_1.isText)(name)) {
|
|
125
|
+
throw new this.leyyo.developerError('Invalid event name', (0, function_1.testCase)(internal_1.FQN, 133), where);
|
|
126
|
+
}
|
|
127
|
+
if (this._deactivatedEvents.has(name)) {
|
|
128
|
+
this._deactivatedEvents.delete(name);
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.EventCommon = EventCommon;
|
|
135
|
+
//# sourceMappingURL=event.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.common.js","sourceRoot":"","sources":["../../src/common/event.common.ts"],"names":[],"mappings":";;;;;;AACA,0CAAgC;AAEhC,0CAA6C;AAC7C,8DAAuC;AAEvC,MAAM,KAAK,GAAG,GAAG,cAAG,cAAc,CAAC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AChB,CAAC;IAED,kBAAkB;IAClB,QAAQ,CAAC,IAAY;QACjB,IAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,EAAE,IAAA,mBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACrC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CAEJ;AAxID,kCAwIC"}
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './deploy.
|
|
3
|
-
export * from './enum.
|
|
4
|
-
export * from './error.
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './log.fn';
|
|
13
|
-
export * from './map.fn';
|
|
14
|
-
export * from './name.fn';
|
|
15
|
-
export * from './opt.fn';
|
|
16
|
-
export * from './opt.fn';
|
|
17
|
-
export * from './test.fn';
|
|
1
|
+
export * from './index.types';
|
|
2
|
+
export * from './deploy.common';
|
|
3
|
+
export * from './enum.pool';
|
|
4
|
+
export * from './error.common';
|
|
5
|
+
export * from './error.pool';
|
|
6
|
+
export * from './event.common';
|
|
7
|
+
export * from './inert';
|
|
8
|
+
export * from './lifecycle.common';
|
|
9
|
+
export * from './literal.pool';
|
|
10
|
+
export * from './log.common';
|
|
11
|
+
export * from './repo.common';
|
package/dist/common/index.js
CHANGED
|
@@ -14,21 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./deploy.
|
|
19
|
-
__exportStar(require("./enum.
|
|
20
|
-
__exportStar(require("./error.
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./log.fn"), exports);
|
|
29
|
-
__exportStar(require("./map.fn"), exports);
|
|
30
|
-
__exportStar(require("./name.fn"), exports);
|
|
31
|
-
__exportStar(require("./opt.fn"), exports);
|
|
32
|
-
__exportStar(require("./opt.fn"), exports);
|
|
33
|
-
__exportStar(require("./test.fn"), exports);
|
|
17
|
+
__exportStar(require("./index.types"), exports);
|
|
18
|
+
__exportStar(require("./deploy.common"), exports);
|
|
19
|
+
__exportStar(require("./enum.pool"), exports);
|
|
20
|
+
__exportStar(require("./error.common"), exports);
|
|
21
|
+
__exportStar(require("./error.pool"), exports);
|
|
22
|
+
__exportStar(require("./event.common"), exports);
|
|
23
|
+
__exportStar(require("./inert"), exports);
|
|
24
|
+
__exportStar(require("./lifecycle.common"), exports);
|
|
25
|
+
__exportStar(require("./literal.pool"), exports);
|
|
26
|
+
__exportStar(require("./log.common"), exports);
|
|
27
|
+
__exportStar(require("./repo.common"), exports);
|
|
34
28
|
//# sourceMappingURL=index.js.map
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAE9B,kDAAgC;AAChC,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,iDAA+B;AAC/B,0CAAwB;AACxB,qDAAmC;AACnC,iDAA+B;AAC/B,+CAA6B;AAC7B,gDAA8B"}
|