@leyyo/common 1.3.5 → 1.3.6
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 +32 -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 +43 -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 +38 -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 +63 -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 +11 -2
- package/dist/index.foretell.js +8 -8
- package/dist/index.foretell.js.map +1 -1
- package/dist/index.js +14 -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 @@
|
|
|
1
|
+
{"version":3,"file":"test-name.js","sourceRoot":"","sources":["../../src/function/test-name.ts"],"names":[],"mappings":";;AAUA,4BAIC;AAdD,qDAA8C;AAC9C,0CAAgC;AAEhC;;;;;;KAMK;AACL,SAAgB,QAAQ,CAAC,QAAgB,EAAE,KAAa;IACpD,QAAQ,GAAG,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,cAAG,IAAI,IAAA,6BAAY,GAAE,EAAE,CAAC;IAClF,KAAK,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACpD,OAAO,SAAS,QAAQ,QAAQ,KAAK,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggerFqn = triggerFqn;
|
|
4
|
+
const const_1 = require("../const");
|
|
5
|
+
function triggerFqn(target, full) {
|
|
6
|
+
if (target[const_1.KEY_FQN_ON_SET]) {
|
|
7
|
+
const arr = target[const_1.KEY_FQN_ON_SET];
|
|
8
|
+
delete target[const_1.KEY_FQN_ON_SET];
|
|
9
|
+
if (Array.isArray(arr)) {
|
|
10
|
+
arr.forEach(callback => {
|
|
11
|
+
if (typeof callback === 'function') {
|
|
12
|
+
try {
|
|
13
|
+
callback(full);
|
|
14
|
+
}
|
|
15
|
+
catch (_e) {
|
|
16
|
+
// nothing
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=trigger-fqn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-fqn.js","sourceRoot":"","sources":["../../src/function/trigger-fqn.ts"],"names":[],"mappings":";;AAGA,gCAkBC;AArBD,oCAAwC;AAGxC,SAAgB,UAAU,CAAC,MAAiB,EAAE,IAAY;IACtD,IAAI,MAAM,CAAC,sBAAc,CAAC,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,MAAM,CAAC,sBAAc,CAA0B,CAAC;QAC5D,OAAO,MAAM,CAAC,sBAAc,CAAC,CAAC;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACnB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;oBACjC,IAAI,CAAC;wBACD,QAAQ,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC;oBAAC,OAAO,EAAE,EAAE,CAAC;wBACV,UAAU;oBACd,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const defLogger: import("./common").Logger;
|
|
2
|
+
export declare const deployCommon: import("./common").DeployCommonLike;
|
|
3
|
+
export declare const enumPool: import("./common").EnumPoolLike;
|
|
4
|
+
export declare const errorCommon: import("./common").ErrorCommonLike;
|
|
5
|
+
export declare const errorPool: import("./common").ErrorPoolLike;
|
|
6
|
+
export declare const eventCommon: import("./common").EventCommonLike<import("./common").EventType>;
|
|
7
|
+
export declare const lifecycleCommon: import("./common").LifecycleCommonLike;
|
|
8
|
+
export declare const logCommon: import("./common").LogCommonLike;
|
|
9
|
+
export declare const repoCommon: import("./common").RepoCommonLike;
|
|
10
|
+
export * from './base';
|
|
2
11
|
export * from './class';
|
|
12
|
+
export * from './common';
|
|
3
13
|
export * from './const';
|
|
4
14
|
export * from './enum';
|
|
5
15
|
export * from './error';
|
|
6
|
-
export * from './common';
|
|
7
16
|
export * from './function';
|
|
8
17
|
export * from './index.loader';
|
|
9
18
|
export * from './index.foretell';
|
package/dist/index.foretell.js
CHANGED
|
@@ -34,47 +34,47 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.foretell_leyyoCommon = void 0;
|
|
37
|
-
const
|
|
37
|
+
const base_1 = require("./base");
|
|
38
38
|
const internal_1 = require("./internal");
|
|
39
39
|
// noinspection JSUnusedGlobalSymbols
|
|
40
40
|
exports.foretell_leyyoCommon = [
|
|
41
41
|
// errors
|
|
42
|
-
() =>
|
|
42
|
+
() => base_1.leyyo.errorPool.register({
|
|
43
43
|
name: 'CausedError',
|
|
44
44
|
fqn: internal_1.FQN,
|
|
45
45
|
i18n: true,
|
|
46
46
|
emit: true,
|
|
47
47
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
48
48
|
}),
|
|
49
|
-
() =>
|
|
49
|
+
() => base_1.leyyo.errorPool.register({
|
|
50
50
|
name: 'DeveloperError',
|
|
51
51
|
fqn: internal_1.FQN,
|
|
52
52
|
i18n: false,
|
|
53
53
|
emit: true,
|
|
54
54
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError)
|
|
55
55
|
}),
|
|
56
|
-
() =>
|
|
56
|
+
() => base_1.leyyo.errorPool.register({
|
|
57
57
|
name: 'CausedError',
|
|
58
58
|
fqn: internal_1.FQN,
|
|
59
59
|
i18n: true,
|
|
60
60
|
emit: true,
|
|
61
61
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
62
62
|
}),
|
|
63
|
-
() =>
|
|
63
|
+
() => base_1.leyyo.errorPool.register({
|
|
64
64
|
name: 'CausedError',
|
|
65
65
|
fqn: internal_1.FQN,
|
|
66
66
|
i18n: true,
|
|
67
67
|
emit: true,
|
|
68
68
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
69
69
|
}),
|
|
70
|
-
() =>
|
|
70
|
+
() => base_1.leyyo.errorPool.register({
|
|
71
71
|
name: 'CausedError',
|
|
72
72
|
fqn: internal_1.FQN,
|
|
73
73
|
i18n: true,
|
|
74
74
|
emit: true,
|
|
75
75
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
76
76
|
}),
|
|
77
|
-
() =>
|
|
77
|
+
() => base_1.leyyo.errorPool.register({
|
|
78
78
|
name: 'CausedError',
|
|
79
79
|
fqn: internal_1.FQN,
|
|
80
80
|
i18n: true,
|
|
@@ -82,7 +82,7 @@ exports.foretell_leyyoCommon = [
|
|
|
82
82
|
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
83
83
|
}),
|
|
84
84
|
// enums
|
|
85
|
-
() =>
|
|
85
|
+
() => base_1.leyyo.literalPool.register({
|
|
86
86
|
name: 'LogLevel',
|
|
87
87
|
fqn: internal_1.FQN,
|
|
88
88
|
i18n: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.foretell.js","sourceRoot":"","sources":["../src/index.foretell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.foretell.js","sourceRoot":"","sources":["../src/index.foretell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA6B;AAC7B,yCAA+B;AAG/B,qCAAqC;AACxB,QAAA,oBAAoB,GAAG;IAChC,SAAS;IACT,GAAG,EAAE,CAAC,YAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QACvB,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,cAAG;QACR,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,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,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,cAAG;QACR,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;KACzD,CACJ;IAED,QAAQ;IACR,GAAG,EAAE,CAAC,YAAK,CAAC,WAAW,CAAC,QAAQ,CAAC;QACzB,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,cAAG;QACR,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,kDAAO,QAAQ,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;KAC1D,CACJ;CACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,15 +14,26 @@ 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
|
+
exports.repoCommon = exports.logCommon = exports.lifecycleCommon = exports.eventCommon = exports.errorPool = exports.errorCommon = exports.enumPool = exports.deployCommon = exports.defLogger = void 0;
|
|
17
18
|
// noinspection JSUnusedGlobalSymbols
|
|
18
19
|
const init_1 = require("./init");
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const base_1 = require("./base");
|
|
21
|
+
(0, init_1.init)();
|
|
22
|
+
exports.defLogger = base_1.leyyo.logger;
|
|
23
|
+
exports.deployCommon = base_1.leyyo.deployCommon;
|
|
24
|
+
exports.enumPool = base_1.leyyo.enumPool;
|
|
25
|
+
exports.errorCommon = base_1.leyyo.errorCommon;
|
|
26
|
+
exports.errorPool = base_1.leyyo.errorPool;
|
|
27
|
+
exports.eventCommon = base_1.leyyo.eventCommon;
|
|
28
|
+
exports.lifecycleCommon = base_1.leyyo.lifecycleCommon;
|
|
29
|
+
exports.logCommon = base_1.leyyo.logCommon;
|
|
30
|
+
exports.repoCommon = base_1.leyyo.repoCommon;
|
|
31
|
+
__exportStar(require("./base"), exports);
|
|
21
32
|
__exportStar(require("./class"), exports);
|
|
33
|
+
__exportStar(require("./common"), exports);
|
|
22
34
|
__exportStar(require("./const"), exports);
|
|
23
35
|
__exportStar(require("./enum"), exports);
|
|
24
36
|
__exportStar(require("./error"), exports);
|
|
25
|
-
__exportStar(require("./common"), exports);
|
|
26
37
|
__exportStar(require("./function"), exports);
|
|
27
38
|
__exportStar(require("./index.loader"), exports);
|
|
28
39
|
__exportStar(require("./index.foretell"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,iCAA4B;AAC5B,iCAA6B;AAE7B,IAAA,WAAI,GAAE,CAAC;AAEM,QAAA,SAAS,GAAG,YAAK,CAAC,MAAM,CAAC;AACzB,QAAA,YAAY,GAAG,YAAK,CAAC,YAAY,CAAC;AAClC,QAAA,QAAQ,GAAG,YAAK,CAAC,QAAQ,CAAC;AAC1B,QAAA,WAAW,GAAG,YAAK,CAAC,WAAW,CAAC;AAChC,QAAA,SAAS,GAAG,YAAK,CAAC,SAAS,CAAC;AAC5B,QAAA,WAAW,GAAG,YAAK,CAAC,WAAW,CAAC;AAChC,QAAA,eAAe,GAAG,YAAK,CAAC,eAAe,CAAC;AACxC,QAAA,SAAS,GAAG,YAAK,CAAC,SAAS,CAAC;AAC5B,QAAA,UAAU,GAAG,YAAK,CAAC,UAAU,CAAC;AAE3C,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,6CAA2B;AAE3B,iDAA+B;AAC/B,mDAAiC"}
|
package/dist/index.loader.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const loader_leyyoCommon: import("./
|
|
1
|
+
export declare const loader_leyyoCommon: import("./function").LoaderLike;
|
package/dist/index.loader.js
CHANGED
|
@@ -34,14 +34,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.loader_leyyoCommon = void 0;
|
|
37
|
+
const function_1 = require("./function");
|
|
37
38
|
const internal_1 = require("./internal");
|
|
38
|
-
const common_1 = require("./common");
|
|
39
39
|
// noinspection JSUnusedGlobalSymbols
|
|
40
|
-
exports.loader_leyyoCommon = (0,
|
|
40
|
+
exports.loader_leyyoCommon = (0, function_1.defineLoader)(internal_1.FQN,
|
|
41
41
|
// errors
|
|
42
42
|
() => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.HttpError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.InvalidValueError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.LeyyoError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.MultipleError),
|
|
43
43
|
// enums
|
|
44
44
|
() => Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems),
|
|
45
45
|
// classes
|
|
46
|
-
() => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.List), () => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.LoggerInstance));
|
|
46
|
+
() => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.List), () => Promise.resolve().then(() => __importStar(require('./class/logger.instance'))).then(m => m.LoggerInstance));
|
|
47
47
|
//# sourceMappingURL=index.loader.js.map
|
package/dist/index.loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.loader.js","sourceRoot":"","sources":["../src/index.loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA+B;
|
|
1
|
+
{"version":3,"file":"index.loader.js","sourceRoot":"","sources":["../src/index.loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwC;AACxC,yCAA+B;AAG/B,qCAAqC;AACxB,QAAA,kBAAkB,GAAG,IAAA,uBAAY,EAAC,cAAG;AAC9C,SAAS;AACT,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAChD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,EACnD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC9C,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,EACtD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/C,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AAClD,QAAQ;AACR,GAAG,EAAE,CAAC,kDAAO,QAAQ,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AACjD,UAAU;AACV,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EACzC,GAAG,EAAE,CAAC,kDAAO,yBAAyB,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CACtE,CAAC"}
|
package/dist/init/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function init(): void;
|
package/dist/init/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
4
|
-
function
|
|
3
|
+
exports.init = init;
|
|
4
|
+
function init() {
|
|
5
5
|
if (global.console) {
|
|
6
6
|
global.console['fatal'] = (...args) => console.error(...args);
|
|
7
7
|
}
|
|
@@ -14,7 +14,8 @@ function $init() {
|
|
|
14
14
|
global.console[name] = () => {
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
if (console) {
|
|
17
|
+
if (console) {
|
|
18
|
+
}
|
|
18
19
|
console[name] = () => {
|
|
19
20
|
};
|
|
20
21
|
});
|
package/dist/init/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/init/index.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/init/index.ts"],"names":[],"mappings":";;AAAA,oBAmBC;AAnBD,SAAgB,IAAI;IAChB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,EAAE,CAAC;QAC3B,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvE,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;gBAClC,CAAC,CAAC;YACN,CAAC;YACD,IAAI,OAAO,EAAE,CAAC;YACd,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;YAC3B,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leyyo/common",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Leyyo common library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"common"
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@babel/preset-env": "^7.29.0",
|
|
35
36
|
"@babel/preset-typescript": "^7.27.0",
|
|
36
37
|
"@types/express": "^5.0.6",
|
|
37
38
|
"@types/geoip-lite": "^1.4.4",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create new array
|
|
3
|
-
*
|
|
4
|
-
* @param {string} name - name of collection
|
|
5
|
-
* @param {boolean} volatile - if yes: it will be removed after lifecycle run
|
|
6
|
-
* @return {Array<any>}
|
|
7
|
-
* */
|
|
8
|
-
export declare function newRepoArray<V>(name: string, volatile?: boolean): Array<V>;
|
|
9
|
-
/**
|
|
10
|
-
* Remove array by given key
|
|
11
|
-
*
|
|
12
|
-
* @param {symbol} key - key of collection
|
|
13
|
-
* @return {number}
|
|
14
|
-
*
|
|
15
|
-
* Return possibilities:
|
|
16
|
-
* - `-2`: key is not valid symbol
|
|
17
|
-
* - `-1`: key does not exist
|
|
18
|
-
* - `>= 0`: length of removed items in collection
|
|
19
|
-
* */
|
|
20
|
-
export declare function removeRepoArray(key: symbol): number;
|
|
21
|
-
/**
|
|
22
|
-
* Clear array by given key
|
|
23
|
-
*
|
|
24
|
-
* @param {symbol} key - key of collection
|
|
25
|
-
* @return {number}
|
|
26
|
-
*
|
|
27
|
-
* Return possibilities:
|
|
28
|
-
* - `-2`: key is not valid symbol
|
|
29
|
-
* - `-1`: key does not exist
|
|
30
|
-
* - `>= 0`: length of cleared items in collection
|
|
31
|
-
* */
|
|
32
|
-
export declare function clearRepoArray(key: symbol): number;
|
|
33
|
-
/**
|
|
34
|
-
* List all array keys
|
|
35
|
-
*
|
|
36
|
-
* @return {Array<symbol>}
|
|
37
|
-
* */
|
|
38
|
-
export declare function listRepoArrays(): Array<symbol>;
|
|
39
|
-
/**
|
|
40
|
-
* Print all arrays
|
|
41
|
-
*
|
|
42
|
-
* @return {Record} - as {key: length of collection}
|
|
43
|
-
*
|
|
44
|
-
* Note: if stringified symbol is duplicated, add index postfix with `#` symbol
|
|
45
|
-
* */
|
|
46
|
-
export declare function printRepoArrays(): Record<string, number>;
|
package/dist/common/array.fn.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newRepoArray = newRepoArray;
|
|
4
|
-
exports.removeRepoArray = removeRepoArray;
|
|
5
|
-
exports.clearRepoArray = clearRepoArray;
|
|
6
|
-
exports.listRepoArrays = listRepoArrays;
|
|
7
|
-
exports.printRepoArrays = printRepoArrays;
|
|
8
|
-
const function_1 = require("../function");
|
|
9
|
-
const error_1 = require("../error");
|
|
10
|
-
const internal_1 = require("../internal");
|
|
11
|
-
const lifecycle_fn_1 = require("./lifecycle.fn");
|
|
12
|
-
const test_fn_1 = require("./test.fn");
|
|
13
|
-
// region properties
|
|
14
|
-
/**
|
|
15
|
-
* Internal items which stores collections
|
|
16
|
-
* */
|
|
17
|
-
const _items = new Map();
|
|
18
|
-
/**
|
|
19
|
-
* Internal volatiles repo which could be cleared after lifecycle run
|
|
20
|
-
* */
|
|
21
|
-
const _volatiles = new Set();
|
|
22
|
-
/**
|
|
23
|
-
* Identifier of file
|
|
24
|
-
* */
|
|
25
|
-
const where = `${internal_1.FQN}.ArrayFn`;
|
|
26
|
-
// endregion properties
|
|
27
|
-
// noinspection JSUnusedGlobalSymbols
|
|
28
|
-
/**
|
|
29
|
-
* Create new array
|
|
30
|
-
*
|
|
31
|
-
* @param {string} name - name of collection
|
|
32
|
-
* @param {boolean} volatile - if yes: it will be removed after lifecycle run
|
|
33
|
-
* @return {Array<any>}
|
|
34
|
-
* */
|
|
35
|
-
function newRepoArray(name, volatile) {
|
|
36
|
-
if (!(0, function_1.isText)(name)) {
|
|
37
|
-
throw new error_1.DeveloperError('Invalid repository array name', (0, test_fn_1.testCase)(internal_1.FQN, 140), where);
|
|
38
|
-
}
|
|
39
|
-
const item = [];
|
|
40
|
-
const code = Symbol.for(name.split('#').join(''));
|
|
41
|
-
_items.set(code, item);
|
|
42
|
-
if (volatile) {
|
|
43
|
-
_volatiles.add(code);
|
|
44
|
-
}
|
|
45
|
-
return item;
|
|
46
|
-
}
|
|
47
|
-
// noinspection JSUnusedGlobalSymbols
|
|
48
|
-
/**
|
|
49
|
-
* Remove array by given key
|
|
50
|
-
*
|
|
51
|
-
* @param {symbol} key - key of collection
|
|
52
|
-
* @return {number}
|
|
53
|
-
*
|
|
54
|
-
* Return possibilities:
|
|
55
|
-
* - `-2`: key is not valid symbol
|
|
56
|
-
* - `-1`: key does not exist
|
|
57
|
-
* - `>= 0`: length of removed items in collection
|
|
58
|
-
* */
|
|
59
|
-
function removeRepoArray(key) {
|
|
60
|
-
const cleared = clearRepoArray(key);
|
|
61
|
-
if (cleared >= 0) {
|
|
62
|
-
_items.delete(key);
|
|
63
|
-
if (_volatiles.has(key)) {
|
|
64
|
-
_volatiles.delete(key);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return cleared;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Clear array by given key
|
|
71
|
-
*
|
|
72
|
-
* @param {symbol} key - key of collection
|
|
73
|
-
* @return {number}
|
|
74
|
-
*
|
|
75
|
-
* Return possibilities:
|
|
76
|
-
* - `-2`: key is not valid symbol
|
|
77
|
-
* - `-1`: key does not exist
|
|
78
|
-
* - `>= 0`: length of cleared items in collection
|
|
79
|
-
* */
|
|
80
|
-
function clearRepoArray(key) {
|
|
81
|
-
if (typeof key !== 'symbol') {
|
|
82
|
-
return -2;
|
|
83
|
-
}
|
|
84
|
-
if (!_items.has(key)) {
|
|
85
|
-
return -1;
|
|
86
|
-
}
|
|
87
|
-
const item = _items.get(key);
|
|
88
|
-
const length = item.length;
|
|
89
|
-
item.splice(0, length);
|
|
90
|
-
return length;
|
|
91
|
-
}
|
|
92
|
-
// noinspection JSUnusedGlobalSymbols
|
|
93
|
-
/**
|
|
94
|
-
* List all array keys
|
|
95
|
-
*
|
|
96
|
-
* @return {Array<symbol>}
|
|
97
|
-
* */
|
|
98
|
-
function listRepoArrays() {
|
|
99
|
-
return Array.from(_items.keys());
|
|
100
|
-
}
|
|
101
|
-
// noinspection JSUnusedGlobalSymbols
|
|
102
|
-
/**
|
|
103
|
-
* Print all arrays
|
|
104
|
-
*
|
|
105
|
-
* @return {Record} - as {key: length of collection}
|
|
106
|
-
*
|
|
107
|
-
* Note: if stringified symbol is duplicated, add index postfix with `#` symbol
|
|
108
|
-
* */
|
|
109
|
-
function printRepoArrays() {
|
|
110
|
-
const result = {};
|
|
111
|
-
let index = 0;
|
|
112
|
-
for (const [sym, item] of _items.entries()) {
|
|
113
|
-
const key = sym.description;
|
|
114
|
-
if (result[key] === undefined) {
|
|
115
|
-
result[key] = item.length;
|
|
116
|
-
index = 0;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
index++;
|
|
120
|
-
result[`${key}#${index}`] = item.length;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
// clear volatile items
|
|
126
|
-
(0, lifecycle_fn_1.addLifecycleStage)('clear', 'repo-array', () => {
|
|
127
|
-
Array.from(_volatiles.values())
|
|
128
|
-
.forEach(key => _items.delete(key));
|
|
129
|
-
_volatiles.clear();
|
|
130
|
-
});
|
|
131
|
-
//# sourceMappingURL=array.fn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.fn.js","sourceRoot":"","sources":["../../src/common/array.fn.ts"],"names":[],"mappings":";;AA+BA,oCAWC;AAcD,0CASC;AAaD,wCAWC;AAQD,wCAEC;AAUD,0CAeC;AA5HD,0CAAmC;AACnC,oCAAwC;AACxC,0CAAgC;AAChC,iDAAiD;AACjD,uCAAmC;AAEnC,oBAAoB;AACpB;;KAEK;AACL,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEjD;;KAEK;AACL,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;AAErC;;KAEK;AACL,MAAM,KAAK,GAAG,GAAG,cAAG,UAAU,CAAC;AAC/B,uBAAuB;AAEvB,qCAAqC;AACrC;;;;;;KAMK;AACL,SAAgB,YAAY,CAAI,IAAY,EAAE,QAAkB;IAC5D,IAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,sBAAc,CAAC,+BAA+B,EAAE,IAAA,kBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,IAAI,GAAG,EAAc,CAAC;IAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IA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eAAe;IAC3B,MAAM,MAAM,GAAG,EAA4B,CAAC;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC;QAC5B,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,KAAK,GAAG,CAAC,CAAC;QACd,CAAC;aACI,CAAC;YACF,KAAK,EAAE,CAAC;YACR,MAAM,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,uBAAuB;AACvB,IAAA,gCAAiB,EAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE;IAC1C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;SAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,UAAU,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Fnc } from "../type";
|
|
2
|
-
/**
|
|
3
|
-
* Wait deploy of a component
|
|
4
|
-
*
|
|
5
|
-
* @param {string} name - name of component
|
|
6
|
-
* @param {function} callback - callback for creator of component, if it completes it, this callback will be called
|
|
7
|
-
* */
|
|
8
|
-
export declare function waitDeploy(name: string, callback: Fnc): void;
|
|
9
|
-
/**
|
|
10
|
-
* Complete deploy of a component
|
|
11
|
-
* - It should be called by owner of component
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @param {string} name - name of component
|
|
16
|
-
* @param {...Array} values - They will be sent to callback of waiting component, {@link waitDeploy}
|
|
17
|
-
* */
|
|
18
|
-
export declare function completeDeploy(name: string, ...values: Array<unknown>): void;
|
package/dist/common/deploy.fn.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitDeploy = waitDeploy;
|
|
4
|
-
exports.completeDeploy = completeDeploy;
|
|
5
|
-
const function_1 = require("../function");
|
|
6
|
-
const error_1 = require("../error");
|
|
7
|
-
const internal_1 = require("../internal");
|
|
8
|
-
const map_fn_1 = require("./map.fn");
|
|
9
|
-
const test_fn_1 = require("./test.fn");
|
|
10
|
-
// region properties
|
|
11
|
-
const where = `${internal_1.FQN}.DeployFn`;
|
|
12
|
-
const waitingCallbacks = (0, map_fn_1.newRepoMap)(`${where}.waitingCallbacks`);
|
|
13
|
-
const alreadyDeployed = (0, map_fn_1.newRepoMap)(`${where}.alreadyDeployed`);
|
|
14
|
-
// endregion properties
|
|
15
|
-
// noinspection JSUnusedGlobalSymbols
|
|
16
|
-
/**
|
|
17
|
-
* Wait deploy of a component
|
|
18
|
-
*
|
|
19
|
-
* @param {string} name - name of component
|
|
20
|
-
* @param {function} callback - callback for creator of component, if it completes it, this callback will be called
|
|
21
|
-
* */
|
|
22
|
-
function waitDeploy(name, callback) {
|
|
23
|
-
if (!(0, function_1.isText)(name)) {
|
|
24
|
-
throw new error_1.DeveloperError('Invalid component name', (0, test_fn_1.testCase)(internal_1.FQN, 120), where);
|
|
25
|
-
}
|
|
26
|
-
if (typeof callback !== 'function') {
|
|
27
|
-
throw new error_1.DeveloperError(`Invalid caller callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 121), where);
|
|
28
|
-
}
|
|
29
|
-
if (alreadyDeployed.has(name)) {
|
|
30
|
-
try {
|
|
31
|
-
callback(...alreadyDeployed.get(name));
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
new error_1.DeveloperError(`Callback error during caller's callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 122), where).log(e);
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (!waitingCallbacks.has(name)) {
|
|
39
|
-
waitingCallbacks.set(name, []);
|
|
40
|
-
}
|
|
41
|
-
waitingCallbacks.get(name).push(callback);
|
|
42
|
-
}
|
|
43
|
-
// noinspection JSUnusedGlobalSymbols
|
|
44
|
-
/**
|
|
45
|
-
* Complete deploy of a component
|
|
46
|
-
* - It should be called by owner of component
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param {string} name - name of component
|
|
51
|
-
* @param {...Array} values - They will be sent to callback of waiting component, {@link waitDeploy}
|
|
52
|
-
* */
|
|
53
|
-
function completeDeploy(name, ...values) {
|
|
54
|
-
if (!(0, function_1.isText)(name)) {
|
|
55
|
-
throw new error_1.DeveloperError('Invalid component name', (0, test_fn_1.testCase)(internal_1.FQN, 123), where);
|
|
56
|
-
}
|
|
57
|
-
const isNew = !alreadyDeployed.has(name);
|
|
58
|
-
alreadyDeployed.set(name, values);
|
|
59
|
-
if (isNew) {
|
|
60
|
-
if (waitingCallbacks.has(name)) {
|
|
61
|
-
const callbacks = waitingCallbacks.get(name);
|
|
62
|
-
waitingCallbacks.delete(name);
|
|
63
|
-
callbacks.forEach(callback => {
|
|
64
|
-
try {
|
|
65
|
-
callback(...values);
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
new error_1.DeveloperError(`Callback error during pending callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 124), where).log(e);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=deploy.fn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.fn.js","sourceRoot":"","sources":["../../src/common/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48 +0,0 @@
|
|
|
1
|
-
import { EnumInertItem, EnumInertOpt } from "../type";
|
|
2
|
-
/**
|
|
3
|
-
* Register an enum
|
|
4
|
-
*
|
|
5
|
-
* @param {EnumInertOpt} options - enum options
|
|
6
|
-
* */
|
|
7
|
-
export declare function registerEnum(options: EnumInertOpt): void;
|
|
8
|
-
/**
|
|
9
|
-
* Check enum defined as lazy, by name
|
|
10
|
-
* Note:
|
|
11
|
-
* - Enum's mode will be shifted lazy to eager after loaded
|
|
12
|
-
*
|
|
13
|
-
* @param {string} name - enum name
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* */
|
|
16
|
-
export declare function isEnumLazy(name: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Check enum defined as eager, by name
|
|
19
|
-
*
|
|
20
|
-
* @param {string} name - enum name
|
|
21
|
-
* @return {boolean}
|
|
22
|
-
* */
|
|
23
|
-
export declare function isEnumEager(name: string): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Check enum defined or not, by name
|
|
26
|
-
*
|
|
27
|
-
* @param {string} name - enum name
|
|
28
|
-
* @return {boolean}
|
|
29
|
-
* */
|
|
30
|
-
export declare function hasEnum(name: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Get enum by name
|
|
33
|
-
* Note:
|
|
34
|
-
* - Enum may be lazy mode, so it has lazy paths without class
|
|
35
|
-
*
|
|
36
|
-
* @param {string} name - enum name
|
|
37
|
-
* @return {EnumInertItem}
|
|
38
|
-
* */
|
|
39
|
-
export declare function getEnum(name: string): EnumInertItem;
|
|
40
|
-
/**
|
|
41
|
-
* Load lazy enum by name
|
|
42
|
-
* Note:
|
|
43
|
-
* - Enum must be exported as `foretell`
|
|
44
|
-
*
|
|
45
|
-
* @param {string} name - name of enum
|
|
46
|
-
* @return {Promise<EnumInertItem>}
|
|
47
|
-
* */
|
|
48
|
-
export declare function loadEnum(name: string): Promise<EnumInertItem>;
|