@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.
Files changed (211) hide show
  1. package/dist/base/index.d.ts +3 -3
  2. package/dist/base/index.js +3 -20
  3. package/dist/base/index.types.d.ts +36 -18
  4. package/dist/base/index.types.js +1 -3
  5. package/dist/base/leyyo.d.ts +1 -1
  6. package/dist/base/leyyo.js +35 -26
  7. package/dist/base/leyyo.types.d.ts +3 -3
  8. package/dist/base/leyyo.types.js +1 -3
  9. package/dist/class/index.d.ts +2 -2
  10. package/dist/class/index.js +2 -19
  11. package/dist/class/index.types.d.ts +1 -1
  12. package/dist/class/index.types.js +1 -3
  13. package/dist/class/list.d.ts +1 -1
  14. package/dist/class/list.js +1 -6
  15. package/dist/class/logger.instance.d.ts +5 -5
  16. package/dist/class/logger.instance.js +8 -12
  17. package/dist/common/deploy.common.d.ts +2 -2
  18. package/dist/common/deploy.common.js +14 -16
  19. package/dist/common/enum.pool.d.ts +5 -3
  20. package/dist/common/enum.pool.js +36 -48
  21. package/dist/common/error.common.d.ts +4 -4
  22. package/dist/common/error.common.js +45 -85
  23. package/dist/common/error.pool.d.ts +5 -3
  24. package/dist/common/error.pool.js +12 -23
  25. package/dist/common/event.common.d.ts +2 -2
  26. package/dist/common/event.common.js +25 -28
  27. package/dist/common/index.d.ts +11 -11
  28. package/dist/common/index.js +11 -28
  29. package/dist/common/index.types.d.ts +42 -6
  30. package/dist/common/index.types.js +1 -3
  31. package/dist/common/inert.d.ts +4 -2
  32. package/dist/common/inert.js +97 -110
  33. package/dist/common/lifecycle.common.d.ts +2 -2
  34. package/dist/common/lifecycle.common.js +48 -61
  35. package/dist/common/literal.pool.d.ts +6 -3
  36. package/dist/common/literal.pool.js +37 -48
  37. package/dist/common/log.common.d.ts +4 -4
  38. package/dist/common/log.common.js +63 -60
  39. package/dist/common/repo.common.d.ts +3 -3
  40. package/dist/common/repo.common.js +50 -52
  41. package/dist/const/index.js +26 -30
  42. package/dist/enum/index.d.ts +1 -1
  43. package/dist/enum/index.js +1 -18
  44. package/dist/enum/log-level.js +1 -5
  45. package/dist/error/caused.error.d.ts +2 -2
  46. package/dist/error/caused.error.js +2 -7
  47. package/dist/error/developer.error.d.ts +3 -3
  48. package/dist/error/developer.error.js +9 -9
  49. package/dist/error/http.error.d.ts +2 -2
  50. package/dist/error/http.error.js +9 -15
  51. package/dist/error/index.d.ts +7 -7
  52. package/dist/error/index.js +7 -24
  53. package/dist/error/index.types.d.ts +3 -3
  54. package/dist/error/index.types.js +1 -3
  55. package/dist/error/invalid-value.error.d.ts +1 -1
  56. package/dist/error/invalid-value.error.js +6 -13
  57. package/dist/error/leyyo.error.d.ts +5 -5
  58. package/dist/error/leyyo.error.js +45 -34
  59. package/dist/error/multiple.error.d.ts +2 -2
  60. package/dist/error/multiple.error.js +6 -12
  61. package/dist/function/define-loader.d.ts +1 -1
  62. package/dist/function/define-loader.js +7 -10
  63. package/dist/function/delay.js +2 -6
  64. package/dist/function/delete-prop.js +9 -15
  65. package/dist/function/{empty.fn.js → empty-fn.js} +1 -5
  66. package/dist/function/extended-type.d.ts +1 -1
  67. package/dist/function/extended-type.js +8 -12
  68. package/dist/function/get-fqn.d.ts +1 -1
  69. package/dist/function/get-fqn.js +7 -12
  70. package/dist/function/get-prop.js +10 -16
  71. package/dist/function/has-fqn.d.ts +1 -1
  72. package/dist/function/has-fqn.js +7 -11
  73. package/dist/function/index.d.ts +38 -28
  74. package/dist/function/index.js +38 -45
  75. package/dist/function/index.types.d.ts +2 -2
  76. package/dist/function/index.types.js +1 -3
  77. package/dist/function/is-anonymous-name.js +3 -7
  78. package/dist/function/is-class.d.ts +7 -0
  79. package/dist/function/is-class.js +18 -0
  80. package/dist/function/is-empty.d.ts +12 -0
  81. package/dist/function/is-empty.js +18 -0
  82. package/dist/function/is-filled-arr.d.ts +10 -0
  83. package/dist/function/is-filled-arr.js +12 -0
  84. package/dist/function/is-filled-obj.d.ts +10 -0
  85. package/dist/function/is-filled-obj.js +13 -0
  86. package/dist/function/is-obj.d.ts +9 -0
  87. package/dist/function/is-obj.js +11 -0
  88. package/dist/function/is-test.js +2 -7
  89. package/dist/function/is-text.d.ts +11 -0
  90. package/dist/function/is-text.js +17 -0
  91. package/dist/function/jitter-interval.js +2 -6
  92. package/dist/function/leyyo-fn.d.ts +1 -1
  93. package/dist/function/leyyo-fn.js +2 -7
  94. package/dist/function/on-fqn-set.d.ts +1 -1
  95. package/dist/function/on-fqn-set.js +9 -13
  96. package/dist/function/one-or-more.d.ts +1 -1
  97. package/dist/function/one-or-more.js +1 -5
  98. package/dist/function/opt-add.d.ts +10 -0
  99. package/dist/function/opt-add.js +29 -0
  100. package/dist/function/opt-append.d.ts +9 -0
  101. package/dist/function/opt-append.js +24 -0
  102. package/dist/function/opt-check.d.ts +8 -0
  103. package/dist/function/opt-check.js +31 -0
  104. package/dist/function/opt-clone.d.ts +8 -0
  105. package/dist/function/opt-clone.js +12 -0
  106. package/dist/function/opt-field.d.ts +11 -0
  107. package/dist/function/opt-field.js +31 -0
  108. package/dist/function/opt-fn.d.ts +8 -0
  109. package/dist/function/opt-fn.js +11 -0
  110. package/dist/function/random-test-no.js +1 -5
  111. package/dist/function/remove-fqn.d.ts +1 -1
  112. package/dist/function/remove-fqn.js +10 -14
  113. package/dist/function/run-exporter.d.ts +1 -1
  114. package/dist/function/run-exporter.js +12 -27
  115. package/dist/function/secure-clone.d.ts +1 -1
  116. package/dist/function/secure-clone.js +2 -7
  117. package/dist/function/secure-json.js +6 -12
  118. package/dist/function/set-anonymous-fqn.d.ts +1 -1
  119. package/dist/function/set-anonymous-fqn.js +15 -19
  120. package/dist/function/set-anonymous-name.d.ts +1 -1
  121. package/dist/function/set-anonymous-name.js +23 -26
  122. package/dist/function/set-fqn.d.ts +1 -1
  123. package/dist/function/set-fqn.js +28 -31
  124. package/dist/function/set-prop.js +9 -15
  125. package/dist/function/stamp-loader.d.ts +1 -1
  126. package/dist/function/stamp-loader.js +4 -8
  127. package/dist/function/test-case.js +5 -9
  128. package/dist/function/test-name.js +4 -8
  129. package/dist/function/trigger-fqn.d.ts +1 -1
  130. package/dist/function/trigger-fqn.js +5 -9
  131. package/dist/index.d.ts +19 -19
  132. package/dist/index.foretell.js +10 -88
  133. package/dist/index.js +22 -40
  134. package/dist/index.loader.d.ts +1 -1
  135. package/dist/index.loader.js +6 -43
  136. package/dist/init/index.js +3 -7
  137. package/dist/internal.js +1 -5
  138. package/package.json +26 -16
  139. package/dist/assets/.gitkeep +0 -0
  140. package/dist/base/index.js.map +0 -1
  141. package/dist/base/index.types.js.map +0 -1
  142. package/dist/base/leyyo.js.map +0 -1
  143. package/dist/base/leyyo.types.js.map +0 -1
  144. package/dist/class/index.js.map +0 -1
  145. package/dist/class/index.types.js.map +0 -1
  146. package/dist/class/list.js.map +0 -1
  147. package/dist/class/logger.instance.js.map +0 -1
  148. package/dist/common/deploy.common.js.map +0 -1
  149. package/dist/common/enum.pool.js.map +0 -1
  150. package/dist/common/error.common.js.map +0 -1
  151. package/dist/common/error.pool.js.map +0 -1
  152. package/dist/common/event.common.js.map +0 -1
  153. package/dist/common/index.js.map +0 -1
  154. package/dist/common/index.types.js.map +0 -1
  155. package/dist/common/inert.js.map +0 -1
  156. package/dist/common/lifecycle.common.js.map +0 -1
  157. package/dist/common/literal.pool.js.map +0 -1
  158. package/dist/common/log.common.js.map +0 -1
  159. package/dist/common/repo.common.js.map +0 -1
  160. package/dist/const/index.js.map +0 -1
  161. package/dist/enum/index.js.map +0 -1
  162. package/dist/enum/log-level.js.map +0 -1
  163. package/dist/error/caused.error.js.map +0 -1
  164. package/dist/error/developer.error.js.map +0 -1
  165. package/dist/error/http.error.js.map +0 -1
  166. package/dist/error/index.js.map +0 -1
  167. package/dist/error/index.types.js.map +0 -1
  168. package/dist/error/invalid-value.error.js.map +0 -1
  169. package/dist/error/leyyo.error.js.map +0 -1
  170. package/dist/error/multiple.error.js.map +0 -1
  171. package/dist/function/define-loader.js.map +0 -1
  172. package/dist/function/delay.js.map +0 -1
  173. package/dist/function/delete-prop.js.map +0 -1
  174. package/dist/function/empty.fn.js.map +0 -1
  175. package/dist/function/extended-type.js.map +0 -1
  176. package/dist/function/get-fqn.js.map +0 -1
  177. package/dist/function/get-prop.js.map +0 -1
  178. package/dist/function/has-fqn.js.map +0 -1
  179. package/dist/function/index.js.map +0 -1
  180. package/dist/function/index.types.js.map +0 -1
  181. package/dist/function/is-anonymous-name.js.map +0 -1
  182. package/dist/function/is-test.js.map +0 -1
  183. package/dist/function/is.fn.d.ts +0 -59
  184. package/dist/function/is.fn.js +0 -93
  185. package/dist/function/is.fn.js.map +0 -1
  186. package/dist/function/jitter-interval.js.map +0 -1
  187. package/dist/function/leyyo-fn.js.map +0 -1
  188. package/dist/function/on-fqn-set.js.map +0 -1
  189. package/dist/function/one-or-more.js.map +0 -1
  190. package/dist/function/opt.fn.d.ts +0 -49
  191. package/dist/function/opt.fn.js +0 -142
  192. package/dist/function/opt.fn.js.map +0 -1
  193. package/dist/function/random-test-no.js.map +0 -1
  194. package/dist/function/remove-fqn.js.map +0 -1
  195. package/dist/function/run-exporter.js.map +0 -1
  196. package/dist/function/secure-clone.js.map +0 -1
  197. package/dist/function/secure-json.js.map +0 -1
  198. package/dist/function/set-anonymous-fqn.js.map +0 -1
  199. package/dist/function/set-anonymous-name.js.map +0 -1
  200. package/dist/function/set-fqn.js.map +0 -1
  201. package/dist/function/set-prop.js.map +0 -1
  202. package/dist/function/stamp-loader.js.map +0 -1
  203. package/dist/function/test-case.js.map +0 -1
  204. package/dist/function/test-name.js.map +0 -1
  205. package/dist/function/trigger-fqn.js.map +0 -1
  206. package/dist/index.foretell.js.map +0 -1
  207. package/dist/index.js.map +0 -1
  208. package/dist/index.loader.js.map +0 -1
  209. package/dist/init/index.js.map +0 -1
  210. package/dist/internal.js.map +0 -1
  211. /package/dist/function/{empty.fn.d.ts → empty-fn.d.ts} +0 -0
@@ -1,53 +1,51 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setAnonymousName = setAnonymousName;
4
- const internal_1 = require("../internal");
5
- const const_1 = require("../const");
6
- const leyyo_fn_1 = require("./leyyo-fn");
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 = `${internal_1.FQN}.nameFn`;
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 = (0, leyyo_fn_1.$$get_leyyo_fn)();
14
+ _leyyo = $$get_leyyo_fn();
17
15
  }
18
- throw new _leyyo.developerError(`Invalid target`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
16
+ throw new _leyyo.developerError(`Invalid target`, testCase(FQN, 'ZZZ'), where);
19
17
  }
20
- if ((0, is_fn_1.isText)(prefix)) {
18
+ if (isText(prefix)) {
21
19
  if (!_pattern.test(prefix)) {
22
20
  if (!_leyyo) {
23
- _leyyo = (0, leyyo_fn_1.$$get_leyyo_fn)();
21
+ _leyyo = $$get_leyyo_fn();
24
22
  }
25
- throw new _leyyo.developerError(`Invalid anonymous name part [${prefix}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
23
+ throw new _leyyo.developerError(`Invalid anonymous name part [${prefix}]`, testCase(FQN, 'ZZZ'), where);
26
24
  }
27
25
  }
28
26
  else {
29
- prefix = (0, is_fn_1.isClass)(target) ? 'Class' : 'function';
27
+ prefix = isClass(target) ? 'Class' : 'function';
30
28
  }
31
29
  _counter++;
32
- const name = const_1.VAL_NAME_ANONYMOUS + [prefix, _counter].join('$');
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 = (0, leyyo_fn_1.$$get_leyyo_fn)();
36
+ _leyyo = $$get_leyyo_fn();
39
37
  }
40
- if (!(0, is_fn_1.isText)(name)) {
41
- throw new _leyyo.developerError(`Invalid name`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
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`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
42
+ throw new _leyyo.developerError(`Invalid name with dot`, testCase(FQN, 'ZZZ'), where);
45
43
  }
46
- if (checkAnonymous && name.startsWith(const_1.VAL_NAME_ANONYMOUS)) {
47
- throw new _leyyo.developerError(`Invalid name with anonymous`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
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}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where);
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}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log(e);
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
@@ -1,4 +1,4 @@
1
- import { FqnTarget } from "./index.types";
1
+ import { FqnTarget } from "./index.types.js";
2
2
  /**
3
3
  * Set fqn name
4
4
  *
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setFqn = setFqn;
4
- const internal_1 = require("../internal");
5
- const leyyo_fn_1 = require("./leyyo-fn");
6
- const is_fn_1 = require("./is.fn");
7
- const test_case_1 = require("./test-case");
8
- const const_1 = require("../const");
9
- const trigger_fqn_1 = require("./trigger-fqn");
10
- const set_anonymous_name_1 = require("./set-anonymous-name");
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 = (0, leyyo_fn_1.$$get_leyyo_fn)();
21
+ _leyyo = $$get_leyyo_fn();
24
22
  }
25
- if (!(0, is_fn_1.isText)(fqn)) {
26
- new _leyyo.developerError('Invalid fqn name', (0, test_case_1.testCase)(internal_1.FQN, 150), where).log();
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', (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log();
28
+ new _leyyo.developerError('Invalid fqn name with dots', testCase(FQN, 'ZZZ'), where).log();
31
29
  return undefined;
32
30
  }
33
- if (fqn.startsWith(const_1.VAL_FQN_ANONYMOUS)) {
34
- new _leyyo.developerError('Anonymous fqn is used', (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log();
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}]`, (0, test_case_1.testCase)(internal_1.FQN, 151), where).log();
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
- (0, set_anonymous_name_1.setAnonymousName)(target, (0, is_fn_1.isClass)(target) ? 'Class' : 'function');
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[const_1.KEY_LITERAL_NAME]) {
50
- return _item(target, target[const_1.KEY_LITERAL_NAME], fqn);
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[const_1.KEY_ENUM_NAME]) {
55
- return _item(target, target[const_1.KEY_ENUM_NAME], fqn);
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`, (0, test_case_1.testCase)(internal_1.FQN, 152), where).log();
58
- return (0, get_fqn_1.getFqn)(target.constructor);
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}]`, (0, test_case_1.testCase)(internal_1.FQN, 152), where).log();
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[const_1.KEY_FQN_NAME] = full;
66
- (0, trigger_fqn_1.triggerFqn)(target, full);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setKey = setKey;
4
- exports.setSymbol = setSymbol;
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 = (0, leyyo_fn_1.$$get_leyyo_fn)();
60
+ _leyyo = $$get_leyyo_fn();
66
61
  }
67
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log(e);
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,4 +1,4 @@
1
- import { LeyyoStampEmpty, LeyyoStampLambda } from "./index.types";
1
+ import { LeyyoStampEmpty, LeyyoStampLambda } from "./index.types.js";
2
2
  /**
3
3
  * Stamp an instance for loader
4
4
  *
@@ -1,18 +1,14 @@
1
- "use strict";
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[const_1.KEY_LOADER_STAMP] = true;
10
+ fn[KEY_LOADER_STAMP] = true;
14
11
  return fn;
15
12
  }
16
- return (() => const_1.KEY_LOADER_EMPTY);
13
+ return (() => KEY_LOADER_EMPTY);
17
14
  }
18
- //# sourceMappingURL=stamp-loader.js.map
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 : internal_1.FQN;
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 = (0, random_test_no_1.randomTestNo)();
20
+ caseStr = randomTestNo();
24
21
  }
25
22
  return `${pck}#${caseStr}`;
26
23
  }
27
- //# sourceMappingURL=test-case.js.map
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 : `${internal_1.FQN}@${(0, random_test_no_1.randomTestNo)()}`;
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
- "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];
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';
@@ -1,92 +1,14 @@
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 __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
- exports.foretell_leyyoCommon = [
4
+ export const foretell_leyyoCommon = [
41
5
  // errors
42
- () => base_1.leyyo.errorPool.register({
43
- name: 'CausedError',
44
- fqn: internal_1.FQN,
45
- i18n: true,
46
- emit: true,
47
- lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
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
- () => base_1.leyyo.literalPool.register({
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
- const init_1 = require("./init");
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.literalPool = base_1.leyyo.literalPool;
29
- exports.lifecycleCommon = base_1.leyyo.lifecycleCommon;
30
- exports.logCommon = base_1.leyyo.logCommon;
31
- exports.repoCommon = base_1.leyyo.repoCommon;
32
- __exportStar(require("./base"), exports);
33
- __exportStar(require("./class"), exports);
34
- __exportStar(require("./common"), exports);
35
- __exportStar(require("./const"), exports);
36
- __exportStar(require("./enum"), exports);
37
- __exportStar(require("./error"), exports);
38
- __exportStar(require("./function"), exports);
39
- __exportStar(require("./index.loader"), exports);
40
- __exportStar(require("./index.foretell"), exports);
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';
@@ -1 +1 @@
1
- export declare const loader_leyyoCommon: import("./function").LoaderLike;
1
+ export declare const loader_leyyoCommon: import("./function/index.types.js").LoaderLike;
@@ -1,47 +1,10 @@
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 __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
- exports.loader_leyyoCommon = (0, function_1.defineLoader)(internal_1.FQN,
4
+ export const loader_leyyoCommon = defineLoader(FQN,
41
5
  // errors
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),
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
- () => Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems),
8
+ () => import('./enum/log-level.js').then(m => m.LogLevelItems),
45
9
  // classes
46
- () => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.List), () => Promise.resolve().then(() => __importStar(require('./class/logger.instance'))).then(m => m.LoggerInstance));
47
- //# sourceMappingURL=index.loader.js.map
10
+ () => import('./class/list.js').then(m => m.List), () => import('./class/logger.instance.js').then(m => m.LoggerInstance));