@leyyo/common 1.3.8 → 1.3.10
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 +36 -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
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const test_case_1 = require("./test-case");
|
|
8
|
-
const is_fn_1 = require("./is.fn");
|
|
1
|
+
import { FQN } from "../internal.js";
|
|
2
|
+
import { VAL_NAME_ANONYMOUS } from "../const/index.js";
|
|
3
|
+
import { $$get_leyyo_fn } from "./leyyo-fn.js";
|
|
4
|
+
import { testCase } from "./test-case.js";
|
|
5
|
+
import { isClass } from "./is-class.js";
|
|
6
|
+
import { isText } from "./is-text.js";
|
|
9
7
|
const _pattern = /((?:[a-zA-Z_$][a-zA-Z\d_$]*)*)([a-zA-Z_$][a-zA-Z\d_$]*)/g;
|
|
10
8
|
let _counter = 0;
|
|
11
|
-
const where = `${
|
|
9
|
+
const where = `${FQN}.nameFn`;
|
|
12
10
|
let _leyyo;
|
|
13
|
-
function setAnonymousName(target, prefix) {
|
|
11
|
+
export function setAnonymousName(target, prefix) {
|
|
14
12
|
if (typeof target !== 'function') {
|
|
15
13
|
if (!_leyyo) {
|
|
16
|
-
_leyyo =
|
|
14
|
+
_leyyo = $$get_leyyo_fn();
|
|
17
15
|
}
|
|
18
|
-
throw new _leyyo.developerError(`Invalid target`,
|
|
16
|
+
throw new _leyyo.developerError(`Invalid target`, testCase(FQN, 'ZZZ'), where);
|
|
19
17
|
}
|
|
20
|
-
if (
|
|
18
|
+
if (isText(prefix)) {
|
|
21
19
|
if (!_pattern.test(prefix)) {
|
|
22
20
|
if (!_leyyo) {
|
|
23
|
-
_leyyo =
|
|
21
|
+
_leyyo = $$get_leyyo_fn();
|
|
24
22
|
}
|
|
25
|
-
throw new _leyyo.developerError(`Invalid anonymous name part [${prefix}]`,
|
|
23
|
+
throw new _leyyo.developerError(`Invalid anonymous name part [${prefix}]`, testCase(FQN, 'ZZZ'), where);
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
else {
|
|
29
|
-
prefix =
|
|
27
|
+
prefix = isClass(target) ? 'Class' : 'function';
|
|
30
28
|
}
|
|
31
29
|
_counter++;
|
|
32
|
-
const name =
|
|
30
|
+
const name = VAL_NAME_ANONYMOUS + [prefix, _counter].join('$');
|
|
33
31
|
_setName(target, name, false);
|
|
34
32
|
return name;
|
|
35
33
|
}
|
|
36
34
|
function _setName(target, name, checkAnonymous) {
|
|
37
35
|
if (!_leyyo) {
|
|
38
|
-
_leyyo =
|
|
36
|
+
_leyyo = $$get_leyyo_fn();
|
|
39
37
|
}
|
|
40
|
-
if (!
|
|
41
|
-
throw new _leyyo.developerError(`Invalid name`,
|
|
38
|
+
if (!isText(name)) {
|
|
39
|
+
throw new _leyyo.developerError(`Invalid name`, testCase(FQN, 'ZZZ'), where);
|
|
42
40
|
}
|
|
43
41
|
if (name.includes('.')) {
|
|
44
|
-
throw new _leyyo.developerError(`Invalid name with dot`,
|
|
42
|
+
throw new _leyyo.developerError(`Invalid name with dot`, testCase(FQN, 'ZZZ'), where);
|
|
45
43
|
}
|
|
46
|
-
if (checkAnonymous && name.startsWith(
|
|
47
|
-
throw new _leyyo.developerError(`Invalid name with anonymous`,
|
|
44
|
+
if (checkAnonymous && name.startsWith(VAL_NAME_ANONYMOUS)) {
|
|
45
|
+
throw new _leyyo.developerError(`Invalid name with anonymous`, testCase(FQN, 'ZZZ'), where);
|
|
48
46
|
}
|
|
49
47
|
if (typeof target !== 'function') {
|
|
50
|
-
throw new _leyyo.developerError(`Invalid name [${name}]`,
|
|
48
|
+
throw new _leyyo.developerError(`Invalid name [${name}]`, testCase(FQN, 'ZZZ'), where);
|
|
51
49
|
}
|
|
52
50
|
try {
|
|
53
51
|
Object.defineProperty(target, 'name', {
|
|
@@ -58,9 +56,8 @@ function _setName(target, name, checkAnonymous) {
|
|
|
58
56
|
});
|
|
59
57
|
}
|
|
60
58
|
catch (e) {
|
|
61
|
-
new _leyyo.developerError(`Unexpected error during set name [${name}]`,
|
|
59
|
+
new _leyyo.developerError(`Unexpected error during set name [${name}]`, testCase(FQN, 'ZZZ'), where).log(e);
|
|
62
60
|
return false;
|
|
63
61
|
}
|
|
64
62
|
return true;
|
|
65
63
|
}
|
|
66
|
-
//# sourceMappingURL=set-anonymous-name.js.map
|
package/dist/function/set-fqn.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const get_fqn_1 = require("./get-fqn");
|
|
12
|
-
const where = `${internal_1.FQN}.FqnFn`;
|
|
1
|
+
import { FQN } from "../internal.js";
|
|
2
|
+
import { $$get_leyyo_fn } from "./leyyo-fn.js";
|
|
3
|
+
import { isClass } from "./is-class.js";
|
|
4
|
+
import { isText } from "./is-text.js";
|
|
5
|
+
import { testCase } from "./test-case.js";
|
|
6
|
+
import { KEY_ENUM_NAME, KEY_FQN_NAME, KEY_LITERAL_NAME, VAL_FQN_ANONYMOUS } from "../const/index.js";
|
|
7
|
+
import { triggerFqn } from "./trigger-fqn.js";
|
|
8
|
+
import { setAnonymousName } from "./set-anonymous-name.js";
|
|
9
|
+
import { getFqn } from "./get-fqn.js";
|
|
10
|
+
const where = `${FQN}.FqnFn`;
|
|
13
11
|
let _leyyo;
|
|
14
12
|
/**
|
|
15
13
|
* Set fqn name
|
|
@@ -18,52 +16,51 @@ let _leyyo;
|
|
|
18
16
|
* @param {string} fqn - fully qualified name
|
|
19
17
|
* @return {string} - full name
|
|
20
18
|
* */
|
|
21
|
-
function setFqn(target, fqn) {
|
|
19
|
+
export function setFqn(target, fqn) {
|
|
22
20
|
if (!_leyyo) {
|
|
23
|
-
_leyyo =
|
|
21
|
+
_leyyo = $$get_leyyo_fn();
|
|
24
22
|
}
|
|
25
|
-
if (!
|
|
26
|
-
new _leyyo.developerError('Invalid fqn name',
|
|
23
|
+
if (!isText(fqn)) {
|
|
24
|
+
new _leyyo.developerError('Invalid fqn name', testCase(FQN, 150), where).log();
|
|
27
25
|
return undefined;
|
|
28
26
|
}
|
|
29
27
|
if (fqn.startsWith('.') || fqn.endsWith('.')) {
|
|
30
|
-
new _leyyo.developerError('Invalid fqn name with dots',
|
|
28
|
+
new _leyyo.developerError('Invalid fqn name with dots', testCase(FQN, 'ZZZ'), where).log();
|
|
31
29
|
return undefined;
|
|
32
30
|
}
|
|
33
|
-
if (fqn.startsWith(
|
|
34
|
-
new _leyyo.developerError('Anonymous fqn is used',
|
|
31
|
+
if (fqn.startsWith(VAL_FQN_ANONYMOUS)) {
|
|
32
|
+
new _leyyo.developerError('Anonymous fqn is used', testCase(FQN, 'ZZZ'), where).log();
|
|
35
33
|
return undefined;
|
|
36
34
|
}
|
|
37
35
|
if (!target) {
|
|
38
|
-
new _leyyo.developerError(`Empty fqn target [${fqn}]`,
|
|
36
|
+
new _leyyo.developerError(`Empty fqn target [${fqn}]`, testCase(FQN, 151), where).log();
|
|
39
37
|
return undefined;
|
|
40
38
|
}
|
|
41
39
|
if (typeof target === 'function') { // function, class
|
|
42
40
|
if (!target.name) {
|
|
43
|
-
|
|
41
|
+
setAnonymousName(target, isClass(target) ? 'Class' : 'function');
|
|
44
42
|
}
|
|
45
43
|
return _item(target, target.name, fqn);
|
|
46
44
|
}
|
|
47
45
|
else if (typeof target === 'object') {
|
|
48
46
|
if (Array.isArray(target)) {
|
|
49
|
-
if (target[
|
|
50
|
-
return _item(target, target[
|
|
47
|
+
if (target[KEY_LITERAL_NAME]) {
|
|
48
|
+
return _item(target, target[KEY_LITERAL_NAME], fqn);
|
|
51
49
|
}
|
|
52
50
|
return undefined;
|
|
53
51
|
}
|
|
54
|
-
if (target[
|
|
55
|
-
return _item(target, target[
|
|
52
|
+
if (target[KEY_ENUM_NAME]) {
|
|
53
|
+
return _item(target, target[KEY_ENUM_NAME], fqn);
|
|
56
54
|
}
|
|
57
|
-
new _leyyo.developerError(`Instance fqn could not be set`,
|
|
58
|
-
return
|
|
55
|
+
new _leyyo.developerError(`Instance fqn could not be set`, testCase(FQN, 152), where).log();
|
|
56
|
+
return getFqn(target.constructor);
|
|
59
57
|
}
|
|
60
|
-
new _leyyo.developerError(`Invalid fqn target [${fqn}]`,
|
|
58
|
+
new _leyyo.developerError(`Invalid fqn target [${fqn}]`, testCase(FQN, 152), where).log();
|
|
61
59
|
return undefined;
|
|
62
60
|
}
|
|
63
61
|
function _item(target, name, fqn) {
|
|
64
62
|
const full = `${fqn}.${name}`;
|
|
65
|
-
target[
|
|
66
|
-
|
|
63
|
+
target[KEY_FQN_NAME] = full;
|
|
64
|
+
triggerFqn(target, full);
|
|
67
65
|
return full;
|
|
68
66
|
}
|
|
69
|
-
//# sourceMappingURL=set-fqn.js.map
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.setProp = setProp;
|
|
6
|
-
const internal_1 = require("../internal");
|
|
7
|
-
const test_case_1 = require("./test-case");
|
|
8
|
-
const leyyo_fn_1 = require("./leyyo-fn");
|
|
9
|
-
const where = `${internal_1.FQN}.DeleteProp`;
|
|
1
|
+
import { FQN } from "../internal.js";
|
|
2
|
+
import { testCase } from "./test-case.js";
|
|
3
|
+
import { $$get_leyyo_fn } from "./leyyo-fn.js";
|
|
4
|
+
const where = `${FQN}.DeleteProp`;
|
|
10
5
|
let _leyyo;
|
|
11
6
|
/**
|
|
12
7
|
* Set target property
|
|
@@ -16,7 +11,7 @@ let _leyyo;
|
|
|
16
11
|
* @param {any} value
|
|
17
12
|
* @return {boolean} - is set?
|
|
18
13
|
* */
|
|
19
|
-
function setKey(target, key, value) {
|
|
14
|
+
export function setKey(target, key, value) {
|
|
20
15
|
if (typeof key !== 'string') {
|
|
21
16
|
return false;
|
|
22
17
|
}
|
|
@@ -30,7 +25,7 @@ function setKey(target, key, value) {
|
|
|
30
25
|
* @param {any} value
|
|
31
26
|
* @return {boolean} - is set?
|
|
32
27
|
* */
|
|
33
|
-
function setSymbol(target, key, value) {
|
|
28
|
+
export function setSymbol(target, key, value) {
|
|
34
29
|
if (typeof key !== 'symbol') {
|
|
35
30
|
return false;
|
|
36
31
|
}
|
|
@@ -44,7 +39,7 @@ function setSymbol(target, key, value) {
|
|
|
44
39
|
* @param {any} value
|
|
45
40
|
* @return {boolean} - is set?
|
|
46
41
|
* */
|
|
47
|
-
function setProp(target, key, value) {
|
|
42
|
+
export function setProp(target, key, value) {
|
|
48
43
|
if (!['symbol', 'string'].includes(typeof key)) {
|
|
49
44
|
return false;
|
|
50
45
|
}
|
|
@@ -62,10 +57,9 @@ function setProp(target, key, value) {
|
|
|
62
57
|
}
|
|
63
58
|
catch (e) {
|
|
64
59
|
if (!_leyyo) {
|
|
65
|
-
_leyyo =
|
|
60
|
+
_leyyo = $$get_leyyo_fn();
|
|
66
61
|
}
|
|
67
|
-
new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`,
|
|
62
|
+
new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
|
|
68
63
|
return false;
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
|
-
//# sourceMappingURL=set-prop.js.map
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stampLoader = stampLoader;
|
|
4
|
-
const const_1 = require("../const");
|
|
1
|
+
import { KEY_LOADER_EMPTY, KEY_LOADER_STAMP } from "../const/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Stamp an instance for loader
|
|
7
4
|
*
|
|
8
5
|
* @param {function} fn - callback function to save
|
|
9
6
|
* @return {(LeyyoStampLambda | LeyyoStampEmpty)} - stamped function
|
|
10
7
|
* */
|
|
11
|
-
function stampLoader(fn) {
|
|
8
|
+
export function stampLoader(fn) {
|
|
12
9
|
if (typeof fn === 'function') {
|
|
13
|
-
fn[
|
|
10
|
+
fn[KEY_LOADER_STAMP] = true;
|
|
14
11
|
return fn;
|
|
15
12
|
}
|
|
16
|
-
return (() =>
|
|
13
|
+
return (() => KEY_LOADER_EMPTY);
|
|
17
14
|
}
|
|
18
|
-
//# sourceMappingURL=stamp-loader.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.testCase = testCase;
|
|
4
|
-
const random_test_no_1 = require("./random-test-no");
|
|
5
|
-
const internal_1 = require("../internal");
|
|
1
|
+
import { randomTestNo } from "./random-test-no.js";
|
|
2
|
+
import { FQN } from "../internal.js";
|
|
6
3
|
/**
|
|
7
4
|
* Build test case
|
|
8
5
|
*
|
|
@@ -10,8 +7,8 @@ const internal_1 = require("../internal");
|
|
|
10
7
|
* @param {(string|number)} caseNo
|
|
11
8
|
* @return {string}
|
|
12
9
|
* */
|
|
13
|
-
function testCase(pck, caseNo) {
|
|
14
|
-
pck = (typeof pck === 'string') ? pck :
|
|
10
|
+
export function testCase(pck, caseNo) {
|
|
11
|
+
pck = (typeof pck === 'string') ? pck : FQN;
|
|
15
12
|
let caseStr;
|
|
16
13
|
if (typeof caseNo === 'string') {
|
|
17
14
|
caseStr = caseNo;
|
|
@@ -20,8 +17,7 @@ function testCase(pck, caseNo) {
|
|
|
20
17
|
caseStr = caseNo.toString(10);
|
|
21
18
|
}
|
|
22
19
|
else {
|
|
23
|
-
caseStr =
|
|
20
|
+
caseStr = randomTestNo();
|
|
24
21
|
}
|
|
25
22
|
return `${pck}#${caseStr}`;
|
|
26
23
|
}
|
|
27
|
-
//# sourceMappingURL=test-case.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.testName = testName;
|
|
4
|
-
const random_test_no_1 = require("./random-test-no");
|
|
5
|
-
const internal_1 = require("../internal");
|
|
1
|
+
import { randomTestNo } from "./random-test-no.js";
|
|
2
|
+
import { FQN } from "../internal.js";
|
|
6
3
|
/**
|
|
7
4
|
* Build test name
|
|
8
5
|
*
|
|
@@ -10,9 +7,8 @@ const internal_1 = require("../internal");
|
|
|
10
7
|
* @param {string} title - test title
|
|
11
8
|
* @return {string}
|
|
12
9
|
* */
|
|
13
|
-
function testName(testCase, title) {
|
|
14
|
-
testCase = (typeof testCase === 'string') ? testCase : `${
|
|
10
|
+
export function testName(testCase, title) {
|
|
11
|
+
testCase = (typeof testCase === 'string') ? testCase : `${FQN}@${randomTestNo()}`;
|
|
15
12
|
title = (typeof title === 'string') ? title : '???';
|
|
16
13
|
return `[test:${testCase}] >> ${title}`;
|
|
17
14
|
}
|
|
18
|
-
//# sourceMappingURL=test-name.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FqnTarget } from "./index.types";
|
|
1
|
+
import { FqnTarget } from "./index.types.js";
|
|
2
2
|
export declare function triggerFqn(target: FqnTarget, full: string): boolean;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
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];
|
|
1
|
+
import { KEY_FQN_ON_SET } from "../const/index.js";
|
|
2
|
+
export function triggerFqn(target, full) {
|
|
3
|
+
if (target[KEY_FQN_ON_SET]) {
|
|
4
|
+
const arr = target[KEY_FQN_ON_SET];
|
|
5
|
+
delete target[KEY_FQN_ON_SET];
|
|
9
6
|
if (Array.isArray(arr)) {
|
|
10
7
|
arr.forEach(callback => {
|
|
11
8
|
if (typeof callback === 'function') {
|
|
@@ -22,4 +19,3 @@ function triggerFqn(target, full) {
|
|
|
22
19
|
}
|
|
23
20
|
return false;
|
|
24
21
|
}
|
|
25
|
-
//# sourceMappingURL=trigger-fqn.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 literalPool: import("./common").LiteralPoolLike;
|
|
8
|
-
export declare const lifecycleCommon: import("./common").LifecycleCommonLike;
|
|
9
|
-
export declare const logCommon: import("./common").LogCommonLike;
|
|
10
|
-
export declare const repoCommon: import("./common").RepoCommonLike;
|
|
11
|
-
export * from './base';
|
|
12
|
-
export * from './class';
|
|
13
|
-
export * from './common';
|
|
14
|
-
export * from './const';
|
|
15
|
-
export * from './enum';
|
|
16
|
-
export * from './error';
|
|
17
|
-
export * from './function';
|
|
18
|
-
export * from './index.loader';
|
|
19
|
-
export * from './index.foretell';
|
|
1
|
+
export declare const defLogger: import("./common/index.types.js").Logger;
|
|
2
|
+
export declare const deployCommon: import("./common/index.types.js").DeployCommonLike;
|
|
3
|
+
export declare const enumPool: import("./common/index.types.js").EnumPoolLike;
|
|
4
|
+
export declare const errorCommon: import("./common/index.types.js").ErrorCommonLike;
|
|
5
|
+
export declare const errorPool: import("./common/index.types.js").ErrorPoolLike;
|
|
6
|
+
export declare const eventCommon: import("./common/index.types.js").EventCommonLike<import("./common/index.types.js").EventType>;
|
|
7
|
+
export declare const literalPool: import("./common/index.types.js").LiteralPoolLike;
|
|
8
|
+
export declare const lifecycleCommon: import("./common/index.types.js").LifecycleCommonLike;
|
|
9
|
+
export declare const logCommon: import("./common/index.types.js").LogCommonLike;
|
|
10
|
+
export declare const repoCommon: import("./common/index.types.js").RepoCommonLike;
|
|
11
|
+
export * from './base/index.js';
|
|
12
|
+
export * from './class/index.js';
|
|
13
|
+
export * from './common/index.js';
|
|
14
|
+
export * from './const/index.js';
|
|
15
|
+
export * from './enum/index.js';
|
|
16
|
+
export * from './error/index.js';
|
|
17
|
+
export * from './function/index.js';
|
|
18
|
+
export * from './index.loader.js';
|
|
19
|
+
export * from './index.foretell.js';
|
package/dist/index.foretell.js
CHANGED
|
@@ -1,92 +1,14 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.foretell_leyyoCommon = void 0;
|
|
37
|
-
const base_1 = require("./base");
|
|
38
|
-
const internal_1 = require("./internal");
|
|
1
|
+
import { leyyo } from "./base/index.js";
|
|
2
|
+
import { FQN } from "./internal.js";
|
|
39
3
|
// noinspection JSUnusedGlobalSymbols
|
|
40
|
-
|
|
4
|
+
export const foretell_leyyoCommon = [
|
|
41
5
|
// errors
|
|
42
|
-
() =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
() => base_1.leyyo.errorPool.register({
|
|
50
|
-
name: 'DeveloperError',
|
|
51
|
-
fqn: internal_1.FQN,
|
|
52
|
-
i18n: false,
|
|
53
|
-
emit: true,
|
|
54
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError)
|
|
55
|
-
}),
|
|
56
|
-
() => base_1.leyyo.errorPool.register({
|
|
57
|
-
name: 'CausedError',
|
|
58
|
-
fqn: internal_1.FQN,
|
|
59
|
-
i18n: true,
|
|
60
|
-
emit: true,
|
|
61
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
62
|
-
}),
|
|
63
|
-
() => base_1.leyyo.errorPool.register({
|
|
64
|
-
name: 'CausedError',
|
|
65
|
-
fqn: internal_1.FQN,
|
|
66
|
-
i18n: true,
|
|
67
|
-
emit: true,
|
|
68
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
69
|
-
}),
|
|
70
|
-
() => base_1.leyyo.errorPool.register({
|
|
71
|
-
name: 'CausedError',
|
|
72
|
-
fqn: internal_1.FQN,
|
|
73
|
-
i18n: true,
|
|
74
|
-
emit: true,
|
|
75
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
76
|
-
}),
|
|
77
|
-
() => base_1.leyyo.errorPool.register({
|
|
78
|
-
name: 'CausedError',
|
|
79
|
-
fqn: internal_1.FQN,
|
|
80
|
-
i18n: true,
|
|
81
|
-
emit: true,
|
|
82
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
83
|
-
}),
|
|
6
|
+
() => leyyo.errorPool.lazy(FQN, 'CausedError', import('./error/caused.error.js').then(m => m.CausedError), { i18n: true, emit: true }),
|
|
7
|
+
() => leyyo.errorPool.lazy(FQN, 'DeveloperError', import('./error/developer.error.js').then(m => m.DeveloperError), { i18n: true, emit: true }),
|
|
8
|
+
() => leyyo.errorPool.lazy(FQN, 'HttpError', import('./error/http.error.js').then(m => m.HttpError), { i18n: true, emit: true }),
|
|
9
|
+
() => leyyo.errorPool.lazy(FQN, 'InvalidValueError', import('./error/invalid-value.error.js').then(m => m.InvalidValueError), { i18n: true, emit: true }),
|
|
10
|
+
() => leyyo.errorPool.lazy(FQN, 'LeyyoError', import('./error/leyyo.error.js').then(m => m.LeyyoError), { i18n: true, emit: false }),
|
|
11
|
+
() => leyyo.errorPool.lazy(FQN, 'MultipleError', import('./error/multiple.error.js').then(m => m.MultipleError), { i18n: true, emit: true }),
|
|
84
12
|
// enums
|
|
85
|
-
() =>
|
|
86
|
-
name: 'LogLevel',
|
|
87
|
-
fqn: internal_1.FQN,
|
|
88
|
-
i18n: true,
|
|
89
|
-
lazyTarget: Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems)
|
|
90
|
-
})
|
|
13
|
+
() => leyyo.literalPool.lazy(FQN, 'LogLevel', import('./enum/log-level.js').then(m => m.LogLevelItems), { i18n: true }),
|
|
91
14
|
];
|
|
92
|
-
//# sourceMappingURL=index.foretell.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
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
|
-
exports.repoCommon = exports.logCommon = exports.lifecycleCommon = exports.literalPool = exports.eventCommon = exports.errorPool = exports.errorCommon = exports.enumPool = exports.deployCommon = exports.defLogger = void 0;
|
|
18
1
|
// noinspection JSUnusedGlobalSymbols
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import { init } from "./init/index.js";
|
|
3
|
+
import { leyyo } from "./base/index.js";
|
|
4
|
+
init();
|
|
5
|
+
export const defLogger = leyyo.logger;
|
|
6
|
+
export const deployCommon = leyyo.deployCommon;
|
|
7
|
+
export const enumPool = leyyo.enumPool;
|
|
8
|
+
export const errorCommon = leyyo.errorCommon;
|
|
9
|
+
export const errorPool = leyyo.errorPool;
|
|
10
|
+
export const eventCommon = leyyo.eventCommon;
|
|
11
|
+
export const literalPool = leyyo.literalPool;
|
|
12
|
+
export const lifecycleCommon = leyyo.lifecycleCommon;
|
|
13
|
+
export const logCommon = leyyo.logCommon;
|
|
14
|
+
export const repoCommon = leyyo.repoCommon;
|
|
15
|
+
export * from './base/index.js';
|
|
16
|
+
export * from './class/index.js';
|
|
17
|
+
export * from './common/index.js';
|
|
18
|
+
export * from './const/index.js';
|
|
19
|
+
export * from './enum/index.js';
|
|
20
|
+
export * from './error/index.js';
|
|
21
|
+
export * from './function/index.js';
|
|
22
|
+
export * from './index.loader.js';
|
|
23
|
+
export * from './index.foretell.js';
|
package/dist/index.loader.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const loader_leyyoCommon: import("./function").LoaderLike;
|
|
1
|
+
export declare const loader_leyyoCommon: import("./function/index.types.js").LoaderLike;
|
package/dist/index.loader.js
CHANGED
|
@@ -1,47 +1,10 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.loader_leyyoCommon = void 0;
|
|
37
|
-
const function_1 = require("./function");
|
|
38
|
-
const internal_1 = require("./internal");
|
|
1
|
+
import { defineLoader } from "./function/index.js";
|
|
2
|
+
import { FQN } from "./internal.js";
|
|
39
3
|
// noinspection JSUnusedGlobalSymbols
|
|
40
|
-
|
|
4
|
+
export const loader_leyyoCommon = defineLoader(FQN,
|
|
41
5
|
// errors
|
|
42
|
-
() =>
|
|
6
|
+
() => import('./error/caused.error.js').then(m => m.CausedError), () => import('./error/developer.error.js').then(m => m.DeveloperError), () => import('./error/http.error.js').then(m => m.HttpError), () => import('./error/invalid-value.error.js').then(m => m.InvalidValueError), () => import('./error/leyyo.error.js').then(m => m.LeyyoError), () => import('./error/multiple.error.js').then(m => m.MultipleError),
|
|
43
7
|
// enums
|
|
44
|
-
() =>
|
|
8
|
+
() => import('./enum/log-level.js').then(m => m.LogLevelItems),
|
|
45
9
|
// classes
|
|
46
|
-
() =>
|
|
47
|
-
//# sourceMappingURL=index.loader.js.map
|
|
10
|
+
() => import('./class/list.js').then(m => m.List), () => import('./class/logger.instance.js').then(m => m.LoggerInstance));
|