@leyyo/common 1.3.8 → 1.3.9
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 -3
- package/dist/base/index.js +3 -20
- package/dist/base/index.types.d.ts +32 -18
- package/dist/base/index.types.js +1 -3
- package/dist/base/leyyo.d.ts +1 -1
- package/dist/base/leyyo.js +35 -26
- package/dist/base/leyyo.types.d.ts +3 -3
- package/dist/base/leyyo.types.js +1 -3
- package/dist/class/index.d.ts +2 -2
- package/dist/class/index.js +2 -19
- package/dist/class/index.types.d.ts +1 -1
- package/dist/class/index.types.js +1 -3
- package/dist/class/list.d.ts +1 -1
- package/dist/class/list.js +1 -6
- package/dist/class/logger.instance.d.ts +5 -5
- package/dist/class/logger.instance.js +8 -12
- package/dist/common/deploy.common.d.ts +2 -2
- package/dist/common/deploy.common.js +14 -16
- package/dist/common/enum.pool.d.ts +5 -3
- package/dist/common/enum.pool.js +36 -48
- package/dist/common/error.common.d.ts +4 -4
- package/dist/common/error.common.js +45 -85
- package/dist/common/error.pool.d.ts +5 -3
- package/dist/common/error.pool.js +12 -23
- package/dist/common/event.common.d.ts +2 -2
- package/dist/common/event.common.js +25 -28
- package/dist/common/index.d.ts +11 -11
- package/dist/common/index.js +11 -28
- package/dist/common/index.types.d.ts +42 -6
- package/dist/common/index.types.js +1 -3
- package/dist/common/inert.d.ts +4 -2
- package/dist/common/inert.js +97 -110
- package/dist/common/lifecycle.common.d.ts +2 -2
- package/dist/common/lifecycle.common.js +48 -61
- package/dist/common/literal.pool.d.ts +6 -3
- package/dist/common/literal.pool.js +37 -48
- package/dist/common/log.common.d.ts +4 -4
- package/dist/common/log.common.js +63 -60
- package/dist/common/repo.common.d.ts +3 -3
- package/dist/common/repo.common.js +50 -52
- package/dist/const/index.js +26 -30
- package/dist/enum/index.d.ts +1 -1
- package/dist/enum/index.js +1 -18
- package/dist/enum/log-level.js +1 -5
- package/dist/error/caused.error.d.ts +2 -2
- package/dist/error/caused.error.js +2 -7
- package/dist/error/developer.error.d.ts +3 -3
- package/dist/error/developer.error.js +9 -9
- package/dist/error/http.error.d.ts +2 -2
- package/dist/error/http.error.js +9 -15
- package/dist/error/index.d.ts +7 -7
- package/dist/error/index.js +7 -24
- package/dist/error/index.types.d.ts +3 -3
- package/dist/error/index.types.js +1 -3
- package/dist/error/invalid-value.error.d.ts +1 -1
- package/dist/error/invalid-value.error.js +6 -13
- package/dist/error/leyyo.error.d.ts +5 -5
- package/dist/error/leyyo.error.js +45 -34
- package/dist/error/multiple.error.d.ts +2 -2
- package/dist/error/multiple.error.js +6 -12
- package/dist/function/define-loader.d.ts +1 -1
- package/dist/function/define-loader.js +7 -10
- package/dist/function/delay.js +2 -6
- package/dist/function/delete-prop.js +9 -15
- package/dist/function/{empty.fn.js → empty-fn.js} +1 -5
- package/dist/function/extended-type.d.ts +1 -1
- package/dist/function/extended-type.js +8 -12
- package/dist/function/get-fqn.d.ts +1 -1
- package/dist/function/get-fqn.js +7 -12
- package/dist/function/get-prop.js +10 -16
- package/dist/function/has-fqn.d.ts +1 -1
- package/dist/function/has-fqn.js +7 -11
- package/dist/function/index.d.ts +38 -28
- package/dist/function/index.js +38 -45
- package/dist/function/index.types.d.ts +2 -2
- package/dist/function/index.types.js +1 -3
- package/dist/function/is-anonymous-name.js +3 -7
- package/dist/function/is-class.d.ts +7 -0
- package/dist/function/is-class.js +18 -0
- package/dist/function/is-empty.d.ts +12 -0
- package/dist/function/is-empty.js +18 -0
- package/dist/function/is-filled-arr.d.ts +10 -0
- package/dist/function/is-filled-arr.js +12 -0
- package/dist/function/is-filled-obj.d.ts +10 -0
- package/dist/function/is-filled-obj.js +13 -0
- package/dist/function/is-obj.d.ts +9 -0
- package/dist/function/is-obj.js +11 -0
- package/dist/function/is-test.js +2 -7
- package/dist/function/is-text.d.ts +11 -0
- package/dist/function/is-text.js +17 -0
- package/dist/function/jitter-interval.js +2 -6
- package/dist/function/leyyo-fn.d.ts +1 -1
- package/dist/function/leyyo-fn.js +2 -7
- package/dist/function/on-fqn-set.d.ts +1 -1
- package/dist/function/on-fqn-set.js +9 -13
- package/dist/function/one-or-more.d.ts +1 -1
- package/dist/function/one-or-more.js +1 -5
- package/dist/function/opt-add.d.ts +10 -0
- package/dist/function/opt-add.js +29 -0
- package/dist/function/opt-append.d.ts +9 -0
- package/dist/function/opt-append.js +24 -0
- package/dist/function/opt-check.d.ts +8 -0
- package/dist/function/opt-check.js +31 -0
- package/dist/function/opt-clone.d.ts +8 -0
- package/dist/function/opt-clone.js +12 -0
- package/dist/function/opt-field.d.ts +11 -0
- package/dist/function/opt-field.js +31 -0
- package/dist/function/opt-fn.d.ts +8 -0
- package/dist/function/opt-fn.js +11 -0
- package/dist/function/random-test-no.js +1 -5
- package/dist/function/remove-fqn.d.ts +1 -1
- package/dist/function/remove-fqn.js +10 -14
- package/dist/function/run-exporter.d.ts +1 -1
- package/dist/function/run-exporter.js +12 -27
- package/dist/function/secure-clone.d.ts +1 -1
- package/dist/function/secure-clone.js +2 -7
- package/dist/function/secure-json.js +6 -12
- package/dist/function/set-anonymous-fqn.d.ts +1 -1
- package/dist/function/set-anonymous-fqn.js +15 -19
- package/dist/function/set-anonymous-name.d.ts +1 -1
- package/dist/function/set-anonymous-name.js +23 -26
- package/dist/function/set-fqn.d.ts +1 -1
- package/dist/function/set-fqn.js +28 -31
- package/dist/function/set-prop.js +9 -15
- package/dist/function/stamp-loader.d.ts +1 -1
- package/dist/function/stamp-loader.js +4 -8
- package/dist/function/test-case.js +5 -9
- package/dist/function/test-name.js +4 -8
- package/dist/function/trigger-fqn.d.ts +1 -1
- package/dist/function/trigger-fqn.js +5 -9
- package/dist/index.d.ts +19 -19
- package/dist/index.foretell.js +10 -88
- package/dist/index.js +22 -40
- package/dist/index.loader.d.ts +1 -1
- package/dist/index.loader.js +6 -43
- package/dist/init/index.js +3 -7
- package/dist/internal.js +1 -5
- package/package.json +26 -16
- package/dist/assets/.gitkeep +0 -0
- package/dist/base/index.js.map +0 -1
- package/dist/base/index.types.js.map +0 -1
- package/dist/base/leyyo.js.map +0 -1
- package/dist/base/leyyo.types.js.map +0 -1
- package/dist/class/index.js.map +0 -1
- package/dist/class/index.types.js.map +0 -1
- package/dist/class/list.js.map +0 -1
- package/dist/class/logger.instance.js.map +0 -1
- package/dist/common/deploy.common.js.map +0 -1
- package/dist/common/enum.pool.js.map +0 -1
- package/dist/common/error.common.js.map +0 -1
- package/dist/common/error.pool.js.map +0 -1
- package/dist/common/event.common.js.map +0 -1
- package/dist/common/index.js.map +0 -1
- package/dist/common/index.types.js.map +0 -1
- package/dist/common/inert.js.map +0 -1
- package/dist/common/lifecycle.common.js.map +0 -1
- package/dist/common/literal.pool.js.map +0 -1
- package/dist/common/log.common.js.map +0 -1
- package/dist/common/repo.common.js.map +0 -1
- package/dist/const/index.js.map +0 -1
- package/dist/enum/index.js.map +0 -1
- package/dist/enum/log-level.js.map +0 -1
- package/dist/error/caused.error.js.map +0 -1
- package/dist/error/developer.error.js.map +0 -1
- package/dist/error/http.error.js.map +0 -1
- package/dist/error/index.js.map +0 -1
- package/dist/error/index.types.js.map +0 -1
- package/dist/error/invalid-value.error.js.map +0 -1
- package/dist/error/leyyo.error.js.map +0 -1
- package/dist/error/multiple.error.js.map +0 -1
- package/dist/function/define-loader.js.map +0 -1
- package/dist/function/delay.js.map +0 -1
- package/dist/function/delete-prop.js.map +0 -1
- package/dist/function/empty.fn.js.map +0 -1
- package/dist/function/extended-type.js.map +0 -1
- package/dist/function/get-fqn.js.map +0 -1
- package/dist/function/get-prop.js.map +0 -1
- package/dist/function/has-fqn.js.map +0 -1
- package/dist/function/index.js.map +0 -1
- package/dist/function/index.types.js.map +0 -1
- package/dist/function/is-anonymous-name.js.map +0 -1
- package/dist/function/is-test.js.map +0 -1
- package/dist/function/is.fn.d.ts +0 -59
- package/dist/function/is.fn.js +0 -93
- package/dist/function/is.fn.js.map +0 -1
- package/dist/function/jitter-interval.js.map +0 -1
- package/dist/function/leyyo-fn.js.map +0 -1
- package/dist/function/on-fqn-set.js.map +0 -1
- package/dist/function/one-or-more.js.map +0 -1
- package/dist/function/opt.fn.d.ts +0 -49
- package/dist/function/opt.fn.js +0 -142
- package/dist/function/opt.fn.js.map +0 -1
- package/dist/function/random-test-no.js.map +0 -1
- package/dist/function/remove-fqn.js.map +0 -1
- package/dist/function/run-exporter.js.map +0 -1
- package/dist/function/secure-clone.js.map +0 -1
- package/dist/function/secure-json.js.map +0 -1
- package/dist/function/set-anonymous-fqn.js.map +0 -1
- package/dist/function/set-anonymous-name.js.map +0 -1
- package/dist/function/set-fqn.js.map +0 -1
- package/dist/function/set-prop.js.map +0 -1
- package/dist/function/stamp-loader.js.map +0 -1
- package/dist/function/test-case.js.map +0 -1
- package/dist/function/test-name.js.map +0 -1
- package/dist/function/trigger-fqn.js.map +0 -1
- package/dist/index.foretell.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.loader.js.map +0 -1
- package/dist/init/index.js.map +0 -1
- package/dist/internal.js.map +0 -1
- /package/dist/function/{empty.fn.d.ts → empty-fn.d.ts} +0 -0
package/dist/base/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './index.types';
|
|
2
|
-
export * from './leyyo.types';
|
|
3
|
-
export * from './leyyo';
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './leyyo.types.js';
|
|
3
|
+
export * from './leyyo.js';
|
package/dist/base/index.js
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./index.types"), exports);
|
|
18
|
-
__exportStar(require("./leyyo.types"), exports);
|
|
19
|
-
__exportStar(require("./leyyo"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './leyyo.types.js';
|
|
3
|
+
export * from './leyyo.js';
|
|
@@ -6,24 +6,26 @@ export type AnyKey = string | number | symbol;
|
|
|
6
6
|
export type Obj = Object & {};
|
|
7
7
|
export type Dict<T = unknown> = Record<KeyValue, T>;
|
|
8
8
|
export type Arr<T = unknown> = Array<T>;
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
9
|
+
export type KeyLike = string | number;
|
|
10
|
+
export type IdLike = string | number;
|
|
11
|
+
export type IntegerLike = number;
|
|
12
|
+
export type FloatLike = number;
|
|
13
|
+
export type AlphaLike = string;
|
|
14
|
+
export type SlugLike = string;
|
|
15
|
+
export type TextLike = string;
|
|
16
|
+
export type DigitLike = string;
|
|
17
|
+
export type TitleLike = string;
|
|
18
|
+
export type DescriptionLike = string;
|
|
19
|
+
export type RichTextLike = string;
|
|
20
|
+
export type UuidLike = string;
|
|
21
|
+
export type HostLike = string;
|
|
22
|
+
export type UrlLike = string;
|
|
23
|
+
export type EmailLike = string;
|
|
24
|
+
export type FolderLike = string;
|
|
25
|
+
export type PhoneLike = string;
|
|
26
|
+
export type UrnLike = string;
|
|
27
|
+
export type HashText = string;
|
|
28
|
+
export type EncryptedText = string;
|
|
27
29
|
export type Fnc<R = unknown> = ((...args: Arr) => R) & Function;
|
|
28
30
|
export type Async<R = unknown> = ((...args: Arr) => Promise<R>) & AsyncGeneratorFunction;
|
|
29
31
|
export interface Abstract<T = {}> extends Function {
|
|
@@ -160,6 +162,18 @@ type OneOfByKey<T> = {
|
|
|
160
162
|
type XorIn<T> = {
|
|
161
163
|
[K in keyof T]: T[K];
|
|
162
164
|
} & unknown;
|
|
165
|
+
export type Timestamp = number;
|
|
166
|
+
export type TimeLong = Timestamp;
|
|
167
|
+
export type TtlMsec = number;
|
|
168
|
+
export type TtlLong = TtlMsec;
|
|
169
|
+
export type EpochTime = number;
|
|
170
|
+
export type TimeShort = EpochTime;
|
|
171
|
+
export type TtlSecond = number;
|
|
172
|
+
export type TtlShort = TtlSecond;
|
|
173
|
+
export type IsoDatetime = string;
|
|
174
|
+
export type IsoDate = string;
|
|
175
|
+
export type IsoTime = string;
|
|
176
|
+
export type JsonText<T = unknown> = string;
|
|
163
177
|
/**
|
|
164
178
|
* JSON Object, record of `JsonValue`
|
|
165
179
|
*
|
package/dist/base/index.types.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
3
2
|
// endregion json
|
|
4
3
|
/*
|
|
5
4
|
|
|
@@ -32,4 +31,3 @@ interface _AsyncFnc<R> extends _BaseFunc {
|
|
|
32
31
|
// export type AnyFnc<R = unknown> = Fnc<R> | Async<R>;
|
|
33
32
|
|
|
34
33
|
*/
|
|
35
|
-
//# sourceMappingURL=index.types.js.map
|
package/dist/base/leyyo.d.ts
CHANGED
package/dist/base/leyyo.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const logger_instance_1 = require("../class/logger.instance");
|
|
7
|
-
const const_1 = require("../const");
|
|
8
|
-
const leyyo_fn_1 = require("../function/leyyo-fn");
|
|
1
|
+
import { DeployCommon, EnumPool, ErrorCommon, ErrorPool, EventCommon, LifecycleCommon, LiteralPool, LogCommon, RepoCommon } from "../common/index.js";
|
|
2
|
+
import { DeveloperError, LeyyoError } from "../error/index.js";
|
|
3
|
+
import { LoggerInstance } from "../class/logger.instance.js";
|
|
4
|
+
import { KEY_SECURE_1 } from "../const/index.js";
|
|
5
|
+
import { $$set_leyyo_fn } from "../function/leyyo-fn.js";
|
|
9
6
|
class Leyyo {
|
|
7
|
+
_developerError;
|
|
8
|
+
_leyyoError;
|
|
9
|
+
_loggerInstance;
|
|
10
|
+
_repoCommon;
|
|
11
|
+
_deployCommon;
|
|
12
|
+
_enumPool;
|
|
13
|
+
_errorCommon;
|
|
14
|
+
_errorPool;
|
|
15
|
+
_eventCommon;
|
|
16
|
+
_lifecycleCommon;
|
|
17
|
+
_literalPool;
|
|
18
|
+
_logCommon;
|
|
19
|
+
_logger;
|
|
10
20
|
constructor() {
|
|
11
21
|
// region binding
|
|
12
|
-
|
|
13
|
-
this._developerError =
|
|
14
|
-
this._developerError[
|
|
15
|
-
this._leyyoError =
|
|
16
|
-
this._leyyoError[
|
|
17
|
-
this._loggerInstance =
|
|
18
|
-
this._loggerInstance[
|
|
22
|
+
$$set_leyyo_fn(this);
|
|
23
|
+
this._developerError = DeveloperError;
|
|
24
|
+
this._developerError[KEY_SECURE_1](this);
|
|
25
|
+
this._leyyoError = LeyyoError;
|
|
26
|
+
this._leyyoError[KEY_SECURE_1](this);
|
|
27
|
+
this._loggerInstance = LoggerInstance;
|
|
28
|
+
this._loggerInstance[KEY_SECURE_1](this);
|
|
19
29
|
// endregion binding
|
|
20
30
|
// region instances
|
|
21
|
-
this._repoCommon = new
|
|
22
|
-
this._errorCommon = new
|
|
23
|
-
this._logCommon = new
|
|
24
|
-
this._eventCommon = new
|
|
25
|
-
this._deployCommon = new
|
|
26
|
-
this._lifecycleCommon = new
|
|
27
|
-
this._enumPool = new
|
|
28
|
-
this._errorPool = new
|
|
29
|
-
this._literalPool = new
|
|
31
|
+
this._repoCommon = new RepoCommon(this); // none
|
|
32
|
+
this._errorCommon = new ErrorCommon(this); // none
|
|
33
|
+
this._logCommon = new LogCommon(this); // repo
|
|
34
|
+
this._eventCommon = new EventCommon(this); // repo
|
|
35
|
+
this._deployCommon = new DeployCommon(this); // repo
|
|
36
|
+
this._lifecycleCommon = new LifecycleCommon(this); // repo
|
|
37
|
+
this._enumPool = new EnumPool(this); // complex
|
|
38
|
+
this._errorPool = new ErrorPool(this);
|
|
39
|
+
this._literalPool = new LiteralPool(this);
|
|
30
40
|
// endregion instances
|
|
31
41
|
// region instance-ops
|
|
32
42
|
this._logger = this._logCommon.of(Leyyo);
|
|
@@ -81,5 +91,4 @@ class Leyyo {
|
|
|
81
91
|
/**
|
|
82
92
|
* Leyyo common instance
|
|
83
93
|
* */
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=leyyo.js.map
|
|
94
|
+
export const leyyo = new Leyyo();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DeveloperErrorCtor, LeyyoErrorCtor } from "../error";
|
|
2
|
-
import { LoggerInstanceCtor } from "../class";
|
|
3
|
-
import { DeployCommonLike, EnumPoolLike, ErrorCommonLike, ErrorPoolLike, EventCommonLike, EventType, LifecycleCommonLike, LiteralPoolLike, LogCommonLike, Logger, RepoCommonLike } from "../common";
|
|
1
|
+
import { DeveloperErrorCtor, LeyyoErrorCtor } from "../error/index.js";
|
|
2
|
+
import { LoggerInstanceCtor } from "../class/index.js";
|
|
3
|
+
import { DeployCommonLike, EnumPoolLike, ErrorCommonLike, ErrorPoolLike, EventCommonLike, EventType, LifecycleCommonLike, LiteralPoolLike, LogCommonLike, Logger, RepoCommonLike } from "../common/index.js";
|
|
4
4
|
export interface LeyyoLike {
|
|
5
5
|
get developerError(): DeveloperErrorCtor;
|
|
6
6
|
get leyyoError(): LeyyoErrorCtor;
|
package/dist/base/leyyo.types.js
CHANGED
package/dist/class/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './index.types';
|
|
2
|
-
export * from './list';
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './list.js';
|
package/dist/class/index.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./index.types"), exports);
|
|
18
|
-
__exportStar(require("./list"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './list.js';
|
package/dist/class/list.d.ts
CHANGED
package/dist/class/list.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.List = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Extended array class, ie: Clearable arrays
|
|
6
3
|
* */
|
|
7
|
-
class List extends Array {
|
|
4
|
+
export class List extends Array {
|
|
8
5
|
constructor(...items) {
|
|
9
6
|
super(...items);
|
|
10
7
|
}
|
|
@@ -33,5 +30,3 @@ class List extends Array {
|
|
|
33
30
|
return false;
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
|
-
exports.List = List;
|
|
37
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LeyyoLike } from "../base";
|
|
2
|
-
import { LogLevel } from "../enum";
|
|
3
|
-
import { Opt } from "../function";
|
|
4
|
-
import { KEY_SECURE_1 } from "../const";
|
|
5
|
-
import { Logger, LoggerSecure } from "../common";
|
|
1
|
+
import { LeyyoLike } from "../base/index.js";
|
|
2
|
+
import { LogLevel } from "../enum/index.js";
|
|
3
|
+
import { Opt } from "../function/index.js";
|
|
4
|
+
import { KEY_SECURE_1 } from "../const/index.js";
|
|
5
|
+
import { Logger, LoggerSecure } from "../common/index.js";
|
|
6
6
|
export declare class LoggerInstance implements Logger, LoggerSecure {
|
|
7
7
|
private _name;
|
|
8
8
|
constructor(name: string);
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.LoggerInstance = void 0;
|
|
4
|
-
const function_1 = require("../function");
|
|
5
|
-
const const_1 = require("../const");
|
|
1
|
+
import { isText } from "../function/index.js";
|
|
2
|
+
import { KEY_SECURE_1 } from "../const/index.js";
|
|
6
3
|
// region property
|
|
7
4
|
let _leyyo;
|
|
8
5
|
// endregion property
|
|
9
6
|
// noinspection JSUnusedLocalSymbols
|
|
10
|
-
class LoggerInstance {
|
|
7
|
+
export class LoggerInstance {
|
|
8
|
+
_name;
|
|
11
9
|
constructor(name) {
|
|
12
|
-
if (!
|
|
10
|
+
if (!isText(name)) {
|
|
13
11
|
name = `Logger@` + Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(10);
|
|
14
12
|
}
|
|
15
13
|
this._name = name;
|
|
16
14
|
}
|
|
17
15
|
// region static
|
|
18
|
-
static [
|
|
16
|
+
static [KEY_SECURE_1](leyyo) {
|
|
19
17
|
if (!_leyyo) {
|
|
20
18
|
_leyyo = leyyo;
|
|
21
19
|
}
|
|
@@ -56,14 +54,14 @@ class LoggerInstance {
|
|
|
56
54
|
}
|
|
57
55
|
/** @inheritDoc */
|
|
58
56
|
$refreshName(name) {
|
|
59
|
-
if (!
|
|
57
|
+
if (!isText(name)) {
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
62
60
|
this._name = name;
|
|
63
61
|
}
|
|
64
62
|
/** @inheritDoc */
|
|
65
63
|
$refreshLevels(level) {
|
|
66
|
-
if (!
|
|
64
|
+
if (!isText(level)) {
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
69
67
|
const rec = {
|
|
@@ -107,5 +105,3 @@ class LoggerInstance {
|
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
|
-
exports.LoggerInstance = LoggerInstance;
|
|
111
|
-
//# sourceMappingURL=logger.instance.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const internal_1 = require("../internal");
|
|
5
|
-
const function_1 = require("../function");
|
|
6
|
-
const where = `${internal_1.FQN}.DeployCommon`;
|
|
1
|
+
import { FQN } from "../internal.js";
|
|
2
|
+
import { isText, testCase } from "../function/index.js";
|
|
3
|
+
const where = `${FQN}.DeployCommon`;
|
|
7
4
|
// noinspection JSUnusedGlobalSymbols
|
|
8
5
|
/**
|
|
9
6
|
* Deploy common interface
|
|
10
7
|
* */
|
|
11
|
-
class DeployCommon {
|
|
8
|
+
export class DeployCommon {
|
|
9
|
+
leyyo;
|
|
10
|
+
_waitingCallbacks;
|
|
11
|
+
_alreadyDeployed;
|
|
12
12
|
constructor(leyyo) {
|
|
13
13
|
this.leyyo = leyyo;
|
|
14
14
|
this._waitingCallbacks = this.leyyo.repoCommon.newMap(`${where}.waitingCallbacks`);
|
|
@@ -21,18 +21,18 @@ class DeployCommon {
|
|
|
21
21
|
* @param {function} callback - callback for creator of component, if it completes it, this callback will be called
|
|
22
22
|
* */
|
|
23
23
|
wait(name, callback) {
|
|
24
|
-
if (!
|
|
25
|
-
throw new this.leyyo.developerError('Invalid component name',
|
|
24
|
+
if (!isText(name)) {
|
|
25
|
+
throw new this.leyyo.developerError('Invalid component name', testCase(FQN, 120), where);
|
|
26
26
|
}
|
|
27
27
|
if (typeof callback !== 'function') {
|
|
28
|
-
throw new this.leyyo.developerError(`Invalid caller callback [${name}]`,
|
|
28
|
+
throw new this.leyyo.developerError(`Invalid caller callback [${name}]`, testCase(FQN, 121), where);
|
|
29
29
|
}
|
|
30
30
|
if (this._alreadyDeployed.has(name)) {
|
|
31
31
|
try {
|
|
32
32
|
callback(...this._alreadyDeployed.get(name));
|
|
33
33
|
}
|
|
34
34
|
catch (e) {
|
|
35
|
-
new this.leyyo.developerError(`Callback error during caller's callback [${name}]`,
|
|
35
|
+
new this.leyyo.developerError(`Callback error during caller's callback [${name}]`, testCase(FQN, 122), where).log(e);
|
|
36
36
|
}
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
@@ -49,8 +49,8 @@ class DeployCommon {
|
|
|
49
49
|
* @param {...Array} values - They will be sent to callback of waiting component, {@link #wait}
|
|
50
50
|
* */
|
|
51
51
|
complete(name, ...values) {
|
|
52
|
-
if (!
|
|
53
|
-
throw new this.leyyo.developerError('Invalid component name',
|
|
52
|
+
if (!isText(name)) {
|
|
53
|
+
throw new this.leyyo.developerError('Invalid component name', testCase(FQN, 123), where);
|
|
54
54
|
}
|
|
55
55
|
const isNew = !this._alreadyDeployed.has(name);
|
|
56
56
|
this._alreadyDeployed.set(name, values);
|
|
@@ -63,12 +63,10 @@ class DeployCommon {
|
|
|
63
63
|
callback(...values);
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
66
|
-
new this.leyyo.developerError(`Callback error during pending callback [${name}]`,
|
|
66
|
+
new this.leyyo.developerError(`Callback error during pending callback [${name}]`, testCase(FQN, 124), where).log(e);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
exports.DeployCommon = DeployCommon;
|
|
74
|
-
//# sourceMappingURL=deploy.common.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Inert } from "./inert";
|
|
2
|
-
import { Enum, EnumItemConfig, EnumPoolItem, EnumPoolLike, EnumPoolOpt } from "./index.types";
|
|
3
|
-
import { LeyyoLike } from "../base";
|
|
1
|
+
import { Inert } from "./inert.js";
|
|
2
|
+
import { Enum, EnumItemConfig, EnumPoolItem, EnumPoolLike, EnumPoolOpt } from "./index.types.js";
|
|
3
|
+
import { LeyyoLike } from "../base/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Enum pool for call with name and lazy loading
|
|
6
6
|
* */
|
|
@@ -20,4 +20,6 @@ export declare class EnumPool extends Inert<EnumPoolItem, Enum, EnumPoolOpt> imp
|
|
|
20
20
|
/** @inheritDoc */
|
|
21
21
|
setConfigItem(enm: Enum, conf: EnumItemConfig): void;
|
|
22
22
|
getConfigItem(enm: Enum): EnumItemConfig;
|
|
23
|
+
/** @inheritDoc */
|
|
24
|
+
define(fqn: string, name: string, target: Enum, opt?: Omit<EnumPoolOpt, 'name' | 'target' | 'lazyTarget' | 'fqn'>): void;
|
|
23
25
|
}
|
package/dist/common/enum.pool.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.EnumPool = void 0;
|
|
13
|
-
const inert_1 = require("./inert");
|
|
14
|
-
const function_1 = require("../function");
|
|
15
|
-
const internal_1 = require("../internal");
|
|
16
|
-
const const_1 = require("../const");
|
|
17
|
-
const where = `${internal_1.FQN}.EnumPool`;
|
|
1
|
+
import { Inert } from "./inert.js";
|
|
2
|
+
import { getSymbol, isEmpty, isFilledObj, isObj, isText, setSymbol, testCase } from "../function/index.js";
|
|
3
|
+
import { FQN } from "../internal.js";
|
|
4
|
+
import { KEY_ENUM_ALT, KEY_ENUM_I18N, KEY_ENUM_NAME } from "../const/index.js";
|
|
5
|
+
const where = `${FQN}.EnumPool`;
|
|
18
6
|
// noinspection JSUnusedGlobalSymbols
|
|
19
7
|
/**
|
|
20
8
|
* Enum pool for call with name and lazy loading
|
|
21
9
|
* */
|
|
22
|
-
class EnumPool extends
|
|
10
|
+
export class EnumPool extends Inert {
|
|
11
|
+
leyyo;
|
|
23
12
|
constructor(leyyo) {
|
|
24
13
|
super(leyyo, 'enum', {});
|
|
25
14
|
this.leyyo = leyyo;
|
|
@@ -27,29 +16,26 @@ class EnumPool extends inert_1.Inert {
|
|
|
27
16
|
// region protected
|
|
28
17
|
/** @inheritDoc */
|
|
29
18
|
_getName(enm) {
|
|
30
|
-
|
|
31
|
-
return (_a = this.getConfigItem(enm)) === null || _a === void 0 ? void 0 : _a.name;
|
|
19
|
+
return this.getConfigItem(enm)?.name;
|
|
32
20
|
}
|
|
33
21
|
/** @inheritDoc */
|
|
34
|
-
_nextLoad(item) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.setConfigItem(item.target, item);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
new this.leyyo.developerError('Callback error during loading enum alternate data', (0, function_1.testCase)(internal_1.FQN, 186), where).log(e);
|
|
44
|
-
}
|
|
22
|
+
async _nextLoad(item) {
|
|
23
|
+
if (item.target && item.lazyAlt) {
|
|
24
|
+
try {
|
|
25
|
+
item.alt = await item.lazyAlt;
|
|
26
|
+
delete item.lazyAlt;
|
|
27
|
+
this.setConfigItem(item.target, item);
|
|
45
28
|
}
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
catch (e) {
|
|
30
|
+
new this.leyyo.developerError('Callback error during loading enum alternate data', testCase(FQN, 186), where).log(e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
delete item.lazyAlt;
|
|
48
34
|
}
|
|
49
35
|
/** @inheritDoc */
|
|
50
36
|
_setName(enm, name) {
|
|
51
|
-
if (
|
|
52
|
-
|
|
37
|
+
if (isText(name)) {
|
|
38
|
+
setSymbol(enm, KEY_ENUM_NAME, name);
|
|
53
39
|
return name;
|
|
54
40
|
}
|
|
55
41
|
return undefined;
|
|
@@ -66,23 +52,23 @@ class EnumPool extends inert_1.Inert {
|
|
|
66
52
|
}
|
|
67
53
|
/** @inheritDoc */
|
|
68
54
|
_validate(enm) {
|
|
69
|
-
return
|
|
55
|
+
return isFilledObj(enm);
|
|
70
56
|
}
|
|
71
57
|
// endregion protected
|
|
72
58
|
// region public
|
|
73
59
|
/** @inheritDoc */
|
|
74
60
|
setConfigItem(enm, conf) {
|
|
75
|
-
if (!
|
|
61
|
+
if (!isObj(conf)) {
|
|
76
62
|
return;
|
|
77
63
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
64
|
+
if (isText(conf.name)) {
|
|
65
|
+
setSymbol(enm, KEY_ENUM_NAME, conf.name);
|
|
80
66
|
}
|
|
81
|
-
if (!
|
|
82
|
-
|
|
67
|
+
if (!isEmpty(conf.i18n)) {
|
|
68
|
+
setSymbol(enm, KEY_ENUM_I18N, conf.i18n);
|
|
83
69
|
}
|
|
84
|
-
if (
|
|
85
|
-
|
|
70
|
+
if (isFilledObj(conf.alt)) {
|
|
71
|
+
setSymbol(enm, KEY_ENUM_ALT, conf.alt);
|
|
86
72
|
}
|
|
87
73
|
}
|
|
88
74
|
getConfigItem(enm) {
|
|
@@ -90,11 +76,13 @@ class EnumPool extends inert_1.Inert {
|
|
|
90
76
|
return undefined;
|
|
91
77
|
}
|
|
92
78
|
return {
|
|
93
|
-
name:
|
|
94
|
-
i18n:
|
|
95
|
-
alt:
|
|
79
|
+
name: getSymbol(enm, KEY_ENUM_NAME),
|
|
80
|
+
i18n: getSymbol(enm, KEY_ENUM_I18N),
|
|
81
|
+
alt: getSymbol(enm, KEY_ENUM_ALT),
|
|
96
82
|
};
|
|
97
83
|
}
|
|
84
|
+
/** @inheritDoc */
|
|
85
|
+
define(fqn, name, target, opt) {
|
|
86
|
+
this.register({ ...(opt ?? {}), fqn, name, target });
|
|
87
|
+
}
|
|
98
88
|
}
|
|
99
|
-
exports.EnumPool = EnumPool;
|
|
100
|
-
//# sourceMappingURL=enum.pool.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ErrorCommonLike, ErrorItemConfig, ErrorObject } from "./index.types";
|
|
2
|
-
import { ClassLike, LeyyoLike } from "../base";
|
|
3
|
-
import { Opt } from "../function";
|
|
4
|
-
import { LeyyoErrorLike } from "../error";
|
|
1
|
+
import { ErrorCommonLike, ErrorItemConfig, ErrorObject } from "./index.types.js";
|
|
2
|
+
import { ClassLike, LeyyoLike } from "../base/index.js";
|
|
3
|
+
import { Opt } from "../function/index.js";
|
|
4
|
+
import { LeyyoErrorLike } from "../error/index.js";
|
|
5
5
|
export declare class ErrorCommon implements ErrorCommonLike {
|
|
6
6
|
private leyyo;
|
|
7
7
|
private _knownPackages;
|