@leyyo/common 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/dist/base/index.d.ts +3 -0
  2. package/dist/base/index.js +20 -0
  3. package/dist/base/index.js.map +1 -0
  4. package/dist/base/index.types.d.ts +196 -0
  5. package/dist/{index.types.js → base/index.types.js} +1 -2
  6. package/dist/base/index.types.js.map +1 -0
  7. package/dist/base/leyyo.d.ts +5 -0
  8. package/dist/base/leyyo.js +85 -0
  9. package/dist/base/leyyo.js.map +1 -0
  10. package/dist/base/leyyo.types.d.ts +18 -0
  11. package/dist/base/leyyo.types.js +3 -0
  12. package/dist/base/leyyo.types.js.map +1 -0
  13. package/dist/class/index.d.ts +1 -1
  14. package/dist/class/index.js +1 -1
  15. package/dist/class/index.js.map +1 -1
  16. package/dist/class/index.types.d.ts +30 -0
  17. package/dist/class/index.types.js +3 -0
  18. package/dist/class/index.types.js.map +1 -0
  19. package/dist/class/list.d.ts +1 -1
  20. package/dist/class/logger.instance.d.ts +14 -10
  21. package/dist/class/logger.instance.js +34 -72
  22. package/dist/class/logger.instance.js.map +1 -1
  23. package/dist/common/deploy.common.d.ts +26 -0
  24. package/dist/common/deploy.common.js +74 -0
  25. package/dist/common/deploy.common.js.map +1 -0
  26. package/dist/common/enum.pool.d.ts +23 -0
  27. package/dist/common/enum.pool.js +100 -0
  28. package/dist/common/enum.pool.js.map +1 -0
  29. package/dist/common/error.common.d.ts +48 -0
  30. package/dist/common/error.common.js +328 -0
  31. package/dist/common/error.common.js.map +1 -0
  32. package/dist/common/error.pool.d.ts +20 -0
  33. package/dist/common/error.pool.js +54 -0
  34. package/dist/common/error.pool.js.map +1 -0
  35. package/dist/common/event.common.d.ts +24 -0
  36. package/dist/common/event.common.js +135 -0
  37. package/dist/common/event.common.js.map +1 -0
  38. package/dist/common/index.d.ts +11 -17
  39. package/dist/common/index.js +11 -17
  40. package/dist/common/index.js.map +1 -1
  41. package/dist/common/index.types.d.ts +561 -0
  42. package/dist/common/index.types.js +4 -0
  43. package/dist/common/index.types.js.map +1 -0
  44. package/dist/common/inert.d.ts +74 -0
  45. package/dist/common/inert.js +302 -0
  46. package/dist/common/inert.js.map +1 -0
  47. package/dist/common/lifecycle.common.d.ts +26 -0
  48. package/dist/common/lifecycle.common.js +124 -0
  49. package/dist/common/lifecycle.common.js.map +1 -0
  50. package/dist/common/literal.pool.d.ts +23 -0
  51. package/dist/common/literal.pool.js +100 -0
  52. package/dist/common/literal.pool.js.map +1 -0
  53. package/dist/common/log.common.d.ts +81 -0
  54. package/dist/common/log.common.js +375 -0
  55. package/dist/common/log.common.js.map +1 -0
  56. package/dist/common/repo.common.d.ts +225 -0
  57. package/dist/common/repo.common.js +474 -0
  58. package/dist/common/repo.common.js.map +1 -0
  59. package/dist/const/index.d.ts +24 -19
  60. package/dist/const/index.js +25 -20
  61. package/dist/const/index.js.map +1 -1
  62. package/dist/enum/log-level.js +0 -2
  63. package/dist/enum/log-level.js.map +1 -1
  64. package/dist/error/caused.error.d.ts +1 -1
  65. package/dist/error/developer.error.d.ts +7 -7
  66. package/dist/error/developer.error.js +11 -29
  67. package/dist/error/developer.error.js.map +1 -1
  68. package/dist/error/http.error.d.ts +1 -1
  69. package/dist/error/http.error.js +3 -3
  70. package/dist/error/http.error.js.map +1 -1
  71. package/dist/error/index.d.ts +1 -0
  72. package/dist/error/index.js +1 -0
  73. package/dist/error/index.js.map +1 -1
  74. package/dist/error/index.types.d.ts +195 -0
  75. package/dist/error/index.types.js +3 -0
  76. package/dist/error/index.types.js.map +1 -0
  77. package/dist/error/invalid-value.error.js +1 -1
  78. package/dist/error/invalid-value.error.js.map +1 -1
  79. package/dist/error/leyyo.error.d.ts +9 -5
  80. package/dist/error/leyyo.error.js +37 -32
  81. package/dist/error/leyyo.error.js.map +1 -1
  82. package/dist/error/multiple.error.d.ts +1 -1
  83. package/dist/error/multiple.error.js.map +1 -1
  84. package/dist/function/define-loader.d.ts +8 -0
  85. package/dist/function/define-loader.js +23 -0
  86. package/dist/function/define-loader.js.map +1 -0
  87. package/dist/function/delete-prop.d.ts +24 -0
  88. package/dist/function/delete-prop.js +76 -0
  89. package/dist/function/delete-prop.js.map +1 -0
  90. package/dist/function/empty.fn.d.ts +1 -2
  91. package/dist/function/empty.fn.js.map +1 -1
  92. package/dist/function/extended-type.d.ts +1 -1
  93. package/dist/function/extended-type.js +8 -5
  94. package/dist/function/extended-type.js.map +1 -1
  95. package/dist/function/get-fqn.d.ts +8 -0
  96. package/dist/function/get-fqn.js +32 -0
  97. package/dist/function/get-fqn.js.map +1 -0
  98. package/dist/function/get-prop.d.ts +24 -0
  99. package/dist/function/get-prop.js +63 -0
  100. package/dist/function/get-prop.js.map +1 -0
  101. package/dist/function/has-fqn.d.ts +8 -0
  102. package/dist/function/has-fqn.js +32 -0
  103. package/dist/function/has-fqn.js.map +1 -0
  104. package/dist/function/index.d.ts +21 -3
  105. package/dist/function/index.js +21 -3
  106. package/dist/function/index.js.map +1 -1
  107. package/dist/function/index.types.d.ts +35 -0
  108. package/dist/function/index.types.js +4 -0
  109. package/dist/function/index.types.js.map +1 -0
  110. package/dist/function/is-anonymous-name.d.ts +1 -0
  111. package/dist/function/is-anonymous-name.js +11 -0
  112. package/dist/function/is-anonymous-name.js.map +1 -0
  113. package/dist/function/is-test.d.ts +10 -0
  114. package/dist/function/is-test.js +37 -0
  115. package/dist/function/is-test.js.map +1 -0
  116. package/dist/function/{is.js → is.fn.js} +1 -1
  117. package/dist/function/is.fn.js.map +1 -0
  118. package/dist/function/leyyo-fn.d.ts +3 -0
  119. package/dist/function/leyyo-fn.js +14 -0
  120. package/dist/function/leyyo-fn.js.map +1 -0
  121. package/dist/function/on-fqn-set.d.ts +2 -0
  122. package/dist/function/on-fqn-set.js +40 -0
  123. package/dist/function/on-fqn-set.js.map +1 -0
  124. package/dist/function/one-or-more.d.ts +1 -1
  125. package/dist/{common → function}/opt.fn.d.ts +2 -1
  126. package/dist/{common → function}/opt.fn.js +15 -10
  127. package/dist/function/opt.fn.js.map +1 -0
  128. package/dist/function/random-test-no.d.ts +6 -0
  129. package/dist/function/random-test-no.js +12 -0
  130. package/dist/function/random-test-no.js.map +1 -0
  131. package/dist/function/remove-fqn.d.ts +10 -0
  132. package/dist/function/remove-fqn.js +43 -0
  133. package/dist/function/remove-fqn.js.map +1 -0
  134. package/dist/{common/exporter.fn.d.ts → function/run-exporter.d.ts} +1 -1
  135. package/dist/{common/exporter.fn.js → function/run-exporter.js} +7 -3
  136. package/dist/function/run-exporter.js.map +1 -0
  137. package/dist/function/secure-clone.d.ts +1 -1
  138. package/dist/function/set-anonymous-fqn.d.ts +2 -0
  139. package/dist/function/set-anonymous-fqn.js +38 -0
  140. package/dist/function/set-anonymous-fqn.js.map +1 -0
  141. package/dist/function/set-anonymous-name.d.ts +2 -0
  142. package/dist/function/set-anonymous-name.js +66 -0
  143. package/dist/function/set-anonymous-name.js.map +1 -0
  144. package/dist/function/set-fqn.d.ts +9 -0
  145. package/dist/function/set-fqn.js +63 -0
  146. package/dist/function/set-fqn.js.map +1 -0
  147. package/dist/function/set-prop.d.ts +27 -0
  148. package/dist/function/set-prop.js +71 -0
  149. package/dist/function/set-prop.js.map +1 -0
  150. package/dist/function/stamp-loader.d.ts +8 -0
  151. package/dist/function/stamp-loader.js +18 -0
  152. package/dist/function/stamp-loader.js.map +1 -0
  153. package/dist/function/test-case.d.ts +8 -0
  154. package/dist/function/test-case.js +27 -0
  155. package/dist/function/test-case.js.map +1 -0
  156. package/dist/function/test-name.d.ts +8 -0
  157. package/dist/function/test-name.js +18 -0
  158. package/dist/function/test-name.js.map +1 -0
  159. package/dist/function/trigger-fqn.d.ts +2 -0
  160. package/dist/function/trigger-fqn.js +25 -0
  161. package/dist/function/trigger-fqn.js.map +1 -0
  162. package/dist/index.d.ts +13 -3
  163. package/dist/index.foretell.d.ts +1 -0
  164. package/dist/{loader.js → index.foretell.js} +12 -18
  165. package/dist/index.foretell.js.map +1 -0
  166. package/dist/index.js +18 -13
  167. package/dist/index.js.map +1 -1
  168. package/dist/index.loader.d.ts +1 -0
  169. package/dist/index.loader.js +47 -0
  170. package/dist/index.loader.js.map +1 -0
  171. package/dist/init/index.d.ts +1 -0
  172. package/dist/init/index.js +24 -0
  173. package/dist/init/index.js.map +1 -0
  174. package/package.json +2 -1
  175. package/dist/common/array.fn.d.ts +0 -46
  176. package/dist/common/array.fn.js +0 -131
  177. package/dist/common/array.fn.js.map +0 -1
  178. package/dist/common/deploy.fn.d.ts +0 -18
  179. package/dist/common/deploy.fn.js +0 -74
  180. package/dist/common/deploy.fn.js.map +0 -1
  181. package/dist/common/enum.fn.d.ts +0 -56
  182. package/dist/common/enum.fn.js +0 -132
  183. package/dist/common/enum.fn.js.map +0 -1
  184. package/dist/common/error.fn.d.ts +0 -107
  185. package/dist/common/error.fn.js +0 -411
  186. package/dist/common/error.fn.js.map +0 -1
  187. package/dist/common/event.fn.d.ts +0 -45
  188. package/dist/common/event.fn.js +0 -161
  189. package/dist/common/event.fn.js.map +0 -1
  190. package/dist/common/exporter.fn.js.map +0 -1
  191. package/dist/common/fqn.fn.d.ts +0 -31
  192. package/dist/common/fqn.fn.js +0 -197
  193. package/dist/common/fqn.fn.js.map +0 -1
  194. package/dist/common/inert.fn.d.ts +0 -69
  195. package/dist/common/inert.fn.js +0 -352
  196. package/dist/common/inert.fn.js.map +0 -1
  197. package/dist/common/lifecycle.fn.d.ts +0 -24
  198. package/dist/common/lifecycle.fn.js +0 -136
  199. package/dist/common/lifecycle.fn.js.map +0 -1
  200. package/dist/common/list.fn.d.ts +0 -47
  201. package/dist/common/list.fn.js +0 -132
  202. package/dist/common/list.fn.js.map +0 -1
  203. package/dist/common/loader.fn.d.ts +0 -15
  204. package/dist/common/loader.fn.js +0 -38
  205. package/dist/common/loader.fn.js.map +0 -1
  206. package/dist/common/log.fn.d.ts +0 -42
  207. package/dist/common/log.fn.js +0 -333
  208. package/dist/common/log.fn.js.map +0 -1
  209. package/dist/common/map.fn.d.ts +0 -46
  210. package/dist/common/map.fn.js +0 -131
  211. package/dist/common/map.fn.js.map +0 -1
  212. package/dist/common/name.fn.d.ts +0 -5
  213. package/dist/common/name.fn.js +0 -69
  214. package/dist/common/name.fn.js.map +0 -1
  215. package/dist/common/opt.fn.js.map +0 -1
  216. package/dist/common/set.fn.d.ts +0 -46
  217. package/dist/common/set.fn.js +0 -131
  218. package/dist/common/set.fn.js.map +0 -1
  219. package/dist/common/test.fn.d.ts +0 -26
  220. package/dist/common/test.fn.js +0 -81
  221. package/dist/common/test.fn.js.map +0 -1
  222. package/dist/function/error-obj.d.ts +0 -8
  223. package/dist/function/error-obj.js +0 -25
  224. package/dist/function/error-obj.js.map +0 -1
  225. package/dist/function/error-text.d.ts +0 -10
  226. package/dist/function/error-text.js +0 -43
  227. package/dist/function/error-text.js.map +0 -1
  228. package/dist/function/is.js.map +0 -1
  229. package/dist/index.types.d.ts +0 -599
  230. package/dist/index.types.js.map +0 -1
  231. package/dist/loader.d.ts +0 -2
  232. package/dist/loader.js.map +0 -1
  233. /package/dist/function/{is.d.ts → is.fn.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-name.js","sourceRoot":"","sources":["../../src/function/test-name.ts"],"names":[],"mappings":";;AAUA,4BAIC;AAdD,qDAA8C;AAC9C,0CAAgC;AAEhC;;;;;;KAMK;AACL,SAAgB,QAAQ,CAAC,QAAgB,EAAE,KAAa;IACpD,QAAQ,GAAG,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,cAAG,IAAI,IAAA,6BAAY,GAAE,EAAE,CAAC;IAClF,KAAK,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACpD,OAAO,SAAS,QAAQ,QAAQ,KAAK,EAAE,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { FqnTarget } from "./index.types";
2
+ export declare function triggerFqn(target: FqnTarget, full: string): boolean;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerFqn = triggerFqn;
4
+ const const_1 = require("../const");
5
+ function triggerFqn(target, full) {
6
+ if (target[const_1.KEY_FQN_ON_SET]) {
7
+ const arr = target[const_1.KEY_FQN_ON_SET];
8
+ delete target[const_1.KEY_FQN_ON_SET];
9
+ if (Array.isArray(arr)) {
10
+ arr.forEach(callback => {
11
+ if (typeof callback === 'function') {
12
+ try {
13
+ callback(full);
14
+ }
15
+ catch (_e) {
16
+ // nothing
17
+ }
18
+ }
19
+ });
20
+ return true;
21
+ }
22
+ }
23
+ return false;
24
+ }
25
+ //# sourceMappingURL=trigger-fqn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-fqn.js","sourceRoot":"","sources":["../../src/function/trigger-fqn.ts"],"names":[],"mappings":";;AAGA,gCAkBC;AArBD,oCAAwC;AAGxC,SAAgB,UAAU,CAAC,MAAiB,EAAE,IAAY;IACtD,IAAI,MAAM,CAAC,sBAAc,CAAC,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,MAAM,CAAC,sBAAc,CAA0B,CAAC;QAC5D,OAAO,MAAM,CAAC,sBAAc,CAAC,CAAC;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACnB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;oBACjC,IAAI,CAAC;wBACD,QAAQ,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC;oBAAC,OAAO,EAAE,EAAE,CAAC;wBACV,UAAU;oBACd,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,18 @@
1
- export * from './index.types';
1
+ export declare const defLogger: import("./common").Logger;
2
+ export declare const deployCommon: import("./common").DeployCommonLike;
3
+ export declare const enumPool: import("./common").EnumPoolLike;
4
+ export declare const errorCommon: import("./common").ErrorCommonLike;
5
+ export declare const errorPool: import("./common").ErrorPoolLike;
6
+ export declare const eventCommon: import("./common").EventCommonLike<import("./common").EventType>;
7
+ export declare const lifecycleCommon: import("./common").LifecycleCommonLike;
8
+ export declare const logCommon: import("./common").LogCommonLike;
9
+ export declare const repoCommon: import("./common").RepoCommonLike;
10
+ export * from './base';
2
11
  export * from './class';
12
+ export * from './common';
3
13
  export * from './const';
4
14
  export * from './enum';
5
15
  export * from './error';
6
- export * from './common';
7
16
  export * from './function';
8
- export * from './loader';
17
+ export * from './index.loader';
18
+ export * from './index.foretell';
@@ -0,0 +1 @@
1
+ export declare const foretell_leyyoCommon: (() => void)[];
@@ -33,66 +33,60 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.foretell_leyyoCommon = exports.loader_leyyoCommon = void 0;
36
+ exports.foretell_leyyoCommon = void 0;
37
+ const base_1 = require("./base");
37
38
  const internal_1 = require("./internal");
38
- const common_1 = require("./common");
39
- // noinspection JSUnusedGlobalSymbols
40
- exports.loader_leyyoCommon = (0, common_1.defineLoader)(internal_1.FQN,
41
- // 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),
43
- // enums
44
- () => Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems),
45
- // classes
46
- () => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.List), () => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.LoggerInstance));
47
39
  // noinspection JSUnusedGlobalSymbols
48
40
  exports.foretell_leyyoCommon = [
49
- () => (0, common_1.defineLazyError)({
41
+ // errors
42
+ () => base_1.leyyo.errorPool.register({
50
43
  name: 'CausedError',
51
44
  fqn: internal_1.FQN,
52
45
  i18n: true,
53
46
  emit: true,
54
47
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
55
48
  }),
56
- () => (0, common_1.defineLazyError)({
49
+ () => base_1.leyyo.errorPool.register({
57
50
  name: 'DeveloperError',
58
51
  fqn: internal_1.FQN,
59
52
  i18n: false,
60
53
  emit: true,
61
54
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError)
62
55
  }),
63
- () => (0, common_1.defineLazyError)({
56
+ () => base_1.leyyo.errorPool.register({
64
57
  name: 'CausedError',
65
58
  fqn: internal_1.FQN,
66
59
  i18n: true,
67
60
  emit: true,
68
61
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
69
62
  }),
70
- () => (0, common_1.defineLazyError)({
63
+ () => base_1.leyyo.errorPool.register({
71
64
  name: 'CausedError',
72
65
  fqn: internal_1.FQN,
73
66
  i18n: true,
74
67
  emit: true,
75
68
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
76
69
  }),
77
- () => (0, common_1.defineLazyError)({
70
+ () => base_1.leyyo.errorPool.register({
78
71
  name: 'CausedError',
79
72
  fqn: internal_1.FQN,
80
73
  i18n: true,
81
74
  emit: true,
82
75
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
83
76
  }),
84
- () => (0, common_1.defineLazyError)({
77
+ () => base_1.leyyo.errorPool.register({
85
78
  name: 'CausedError',
86
79
  fqn: internal_1.FQN,
87
80
  i18n: true,
88
81
  emit: true,
89
82
  lazyTarget: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
90
83
  }),
91
- () => (0, common_1.defineLazyEnum)({
84
+ // enums
85
+ () => base_1.leyyo.literalPool.register({
92
86
  name: 'LogLevel',
93
87
  fqn: internal_1.FQN,
94
88
  i18n: true,
95
89
  lazyTarget: Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems)
96
90
  })
97
91
  ];
98
- //# sourceMappingURL=loader.js.map
92
+ //# sourceMappingURL=index.foretell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.foretell.js","sourceRoot":"","sources":["../src/index.foretell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA6B;AAC7B,yCAA+B;AAG/B,qCAAqC;AACxB,QAAA,oBAAoB,GAAG;IAChC,SAAS;IACT,GAAG,EAAE,CAAC,YAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QACvB,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,cAAG;QACR,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;KACzD,CACJ;IACD,GAAG,EAAE,CAAC,YAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QACvB,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,cAAG;QACR,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;KAC5D,CACJ;IACD,GAAG,EAAE,CAAC,YAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QACvB,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,cAAG;QAC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 +1,4 @@
1
1
  "use strict";
2
- // noinspection JSUnusedGlobalSymbols
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
5
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -15,21 +14,27 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
15
  };
17
16
  Object.defineProperty(exports, "__esModule", { value: true });
18
- if (global === null || global === void 0 ? void 0 : global.leyyo_is_testing) {
19
- ['log', 'warn', 'info', 'debug', 'trace', 'error'].forEach(name => {
20
- global.console[name] = () => {
21
- };
22
- console[name] = () => {
23
- };
24
- });
25
- }
26
- console['fatal'] = (...args) => console.error(...args);
27
- __exportStar(require("./index.types"), exports);
17
+ exports.repoCommon = exports.logCommon = exports.lifecycleCommon = exports.eventCommon = exports.errorPool = exports.errorCommon = exports.enumPool = exports.deployCommon = exports.defLogger = void 0;
18
+ // 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.lifecycleCommon = base_1.leyyo.lifecycleCommon;
29
+ exports.logCommon = base_1.leyyo.logCommon;
30
+ exports.repoCommon = base_1.leyyo.repoCommon;
31
+ __exportStar(require("./base"), exports);
28
32
  __exportStar(require("./class"), exports);
33
+ __exportStar(require("./common"), exports);
29
34
  __exportStar(require("./const"), exports);
30
35
  __exportStar(require("./enum"), exports);
31
36
  __exportStar(require("./error"), exports);
32
- __exportStar(require("./common"), exports);
33
37
  __exportStar(require("./function"), exports);
34
- __exportStar(require("./loader"), exports);
38
+ __exportStar(require("./index.loader"), exports);
39
+ __exportStar(require("./index.foretell"), exports);
35
40
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;;;;;;;;;;;;;;AAErC,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,EAAE,CAAC;IAC3B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC9D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;QAClC,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;QAC3B,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AAGvE,gDAA8B;AAE9B,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,iCAA4B;AAC5B,iCAA6B;AAE7B,IAAA,WAAI,GAAE,CAAC;AAEM,QAAA,SAAS,GAAG,YAAK,CAAC,MAAM,CAAC;AACzB,QAAA,YAAY,GAAG,YAAK,CAAC,YAAY,CAAC;AAClC,QAAA,QAAQ,GAAG,YAAK,CAAC,QAAQ,CAAC;AAC1B,QAAA,WAAW,GAAG,YAAK,CAAC,WAAW,CAAC;AAChC,QAAA,SAAS,GAAG,YAAK,CAAC,SAAS,CAAC;AAC5B,QAAA,WAAW,GAAG,YAAK,CAAC,WAAW,CAAC;AAChC,QAAA,eAAe,GAAG,YAAK,CAAC,eAAe,CAAC;AACxC,QAAA,SAAS,GAAG,YAAK,CAAC,SAAS,CAAC;AAC5B,QAAA,UAAU,GAAG,YAAK,CAAC,UAAU,CAAC;AAE3C,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,6CAA2B;AAE3B,iDAA+B;AAC/B,mDAAiC"}
@@ -0,0 +1 @@
1
+ export declare const loader_leyyoCommon: import("./function").LoaderLike;
@@ -0,0 +1,47 @@
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");
39
+ // noinspection JSUnusedGlobalSymbols
40
+ exports.loader_leyyoCommon = (0, function_1.defineLoader)(internal_1.FQN,
41
+ // 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),
43
+ // enums
44
+ () => Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems),
45
+ // 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.loader.js","sourceRoot":"","sources":["../src/index.loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAwC;AACxC,yCAA+B;AAG/B,qCAAqC;AACxB,QAAA,kBAAkB,GAAG,IAAA,uBAAY,EAAC,cAAG;AAC9C,SAAS;AACT,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAChD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,EACnD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC9C,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,EACtD,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/C,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AAClD,QAAQ;AACR,GAAG,EAAE,CAAC,kDAAO,QAAQ,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;AACjD,UAAU;AACV,GAAG,EAAE,CAAC,kDAAO,SAAS,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EACzC,GAAG,EAAE,CAAC,kDAAO,yBAAyB,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CACtE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function init(): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.init = init;
4
+ function init() {
5
+ if (global.console) {
6
+ global.console['fatal'] = (...args) => console.error(...args);
7
+ }
8
+ if (console) {
9
+ console['fatal'] = (...args) => console.error(...args);
10
+ }
11
+ if (global === null || global === void 0 ? void 0 : global.leyyo_is_testing) {
12
+ ['log', 'debug', 'trace', 'info', 'warn', 'error', 'fatal'].forEach(name => {
13
+ if (global === null || global === void 0 ? void 0 : global.console) {
14
+ global.console[name] = () => {
15
+ };
16
+ }
17
+ if (console) {
18
+ }
19
+ console[name] = () => {
20
+ };
21
+ });
22
+ }
23
+ }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/init/index.ts"],"names":[],"mappings":";;AAAA,oBAmBC;AAnBD,SAAgB,IAAI;IAChB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,EAAE,CAAC;QAC3B,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvE,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,EAAE,CAAC;gBAClB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;gBAClC,CAAC,CAAC;YACN,CAAC;YACD,IAAI,OAAO,EAAE,CAAC;YACd,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;YAC3B,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leyyo/common",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Leyyo common library",
5
5
  "keywords": [
6
6
  "common"
@@ -32,6 +32,7 @@
32
32
  ],
33
33
  "license": "ISC",
34
34
  "devDependencies": {
35
+ "@babel/preset-env": "^7.29.0",
35
36
  "@babel/preset-typescript": "^7.27.0",
36
37
  "@types/express": "^5.0.6",
37
38
  "@types/geoip-lite": "^1.4.4",
@@ -1,46 +0,0 @@
1
- /**
2
- * Create new array
3
- *
4
- * @param {string} name - name of collection
5
- * @param {boolean} volatile - if yes: it will be removed after lifecycle run
6
- * @return {Array<any>}
7
- * */
8
- export declare function newRepoArray<V>(name: string, volatile?: boolean): Array<V>;
9
- /**
10
- * Remove array by given key
11
- *
12
- * @param {symbol} key - key of collection
13
- * @return {number}
14
- *
15
- * Return possibilities:
16
- * - `-2`: key is not valid symbol
17
- * - `-1`: key does not exist
18
- * - `>= 0`: length of removed items in collection
19
- * */
20
- export declare function removeRepoArray(key: symbol): number;
21
- /**
22
- * Clear array by given key
23
- *
24
- * @param {symbol} key - key of collection
25
- * @return {number}
26
- *
27
- * Return possibilities:
28
- * - `-2`: key is not valid symbol
29
- * - `-1`: key does not exist
30
- * - `>= 0`: length of cleared items in collection
31
- * */
32
- export declare function clearRepoArray(key: symbol): number;
33
- /**
34
- * List all array keys
35
- *
36
- * @return {Array<symbol>}
37
- * */
38
- export declare function listRepoArrays(): Array<symbol>;
39
- /**
40
- * Print all arrays
41
- *
42
- * @return {Record} - as {key: length of collection}
43
- *
44
- * Note: if stringified symbol is duplicated, add index postfix with `#` symbol
45
- * */
46
- export declare function printRepoArrays(): Record<string, number>;
@@ -1,131 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newRepoArray = newRepoArray;
4
- exports.removeRepoArray = removeRepoArray;
5
- exports.clearRepoArray = clearRepoArray;
6
- exports.listRepoArrays = listRepoArrays;
7
- exports.printRepoArrays = printRepoArrays;
8
- const function_1 = require("../function");
9
- const error_1 = require("../error");
10
- const internal_1 = require("../internal");
11
- const lifecycle_fn_1 = require("./lifecycle.fn");
12
- const test_fn_1 = require("./test.fn");
13
- // region properties
14
- /**
15
- * Internal items which stores collections
16
- * */
17
- const _items = new Map();
18
- /**
19
- * Internal volatiles repo which could be cleared after lifecycle run
20
- * */
21
- const _volatiles = new Set();
22
- /**
23
- * Identifier of file
24
- * */
25
- const where = `${internal_1.FQN}.ArrayFn`;
26
- // endregion properties
27
- // noinspection JSUnusedGlobalSymbols
28
- /**
29
- * Create new array
30
- *
31
- * @param {string} name - name of collection
32
- * @param {boolean} volatile - if yes: it will be removed after lifecycle run
33
- * @return {Array<any>}
34
- * */
35
- function newRepoArray(name, volatile) {
36
- if (!(0, function_1.isText)(name)) {
37
- throw new error_1.DeveloperError('Invalid repository array name', (0, test_fn_1.testCase)(internal_1.FQN, 140), where);
38
- }
39
- const item = [];
40
- const code = Symbol.for(name.split('#').join(''));
41
- _items.set(code, item);
42
- if (volatile) {
43
- _volatiles.add(code);
44
- }
45
- return item;
46
- }
47
- // noinspection JSUnusedGlobalSymbols
48
- /**
49
- * Remove array by given key
50
- *
51
- * @param {symbol} key - key of collection
52
- * @return {number}
53
- *
54
- * Return possibilities:
55
- * - `-2`: key is not valid symbol
56
- * - `-1`: key does not exist
57
- * - `>= 0`: length of removed items in collection
58
- * */
59
- function removeRepoArray(key) {
60
- const cleared = clearRepoArray(key);
61
- if (cleared >= 0) {
62
- _items.delete(key);
63
- if (_volatiles.has(key)) {
64
- _volatiles.delete(key);
65
- }
66
- }
67
- return cleared;
68
- }
69
- /**
70
- * Clear array by given key
71
- *
72
- * @param {symbol} key - key of collection
73
- * @return {number}
74
- *
75
- * Return possibilities:
76
- * - `-2`: key is not valid symbol
77
- * - `-1`: key does not exist
78
- * - `>= 0`: length of cleared items in collection
79
- * */
80
- function clearRepoArray(key) {
81
- if (typeof key !== 'symbol') {
82
- return -2;
83
- }
84
- if (!_items.has(key)) {
85
- return -1;
86
- }
87
- const item = _items.get(key);
88
- const length = item.length;
89
- item.splice(0, length);
90
- return length;
91
- }
92
- // noinspection JSUnusedGlobalSymbols
93
- /**
94
- * List all array keys
95
- *
96
- * @return {Array<symbol>}
97
- * */
98
- function listRepoArrays() {
99
- return Array.from(_items.keys());
100
- }
101
- // noinspection JSUnusedGlobalSymbols
102
- /**
103
- * Print all arrays
104
- *
105
- * @return {Record} - as {key: length of collection}
106
- *
107
- * Note: if stringified symbol is duplicated, add index postfix with `#` symbol
108
- * */
109
- function printRepoArrays() {
110
- const result = {};
111
- let index = 0;
112
- for (const [sym, item] of _items.entries()) {
113
- const key = sym.description;
114
- if (result[key] === undefined) {
115
- result[key] = item.length;
116
- index = 0;
117
- }
118
- else {
119
- index++;
120
- result[`${key}#${index}`] = item.length;
121
- }
122
- }
123
- return result;
124
- }
125
- // clear volatile items
126
- (0, lifecycle_fn_1.addLifecycleStage)('clear', 'repo-array', () => {
127
- Array.from(_volatiles.values())
128
- .forEach(key => _items.delete(key));
129
- _volatiles.clear();
130
- });
131
- //# sourceMappingURL=array.fn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.fn.js","sourceRoot":"","sources":["../../src/common/array.fn.ts"],"names":[],"mappings":";;AA+BA,oCAWC;AAcD,0CASC;AAaD,wCAWC;AAQD,wCAEC;AAUD,0CAeC;AA5HD,0CAAmC;AACnC,oCAAwC;AACxC,0CAAgC;AAChC,iDAAiD;AACjD,uCAAmC;AAEnC,oBAAoB;AACpB;;KAEK;AACL,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEjD;;KAEK;AACL,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;AAErC;;KAEK;AACL,MAAM,KAAK,GAAG,GAAG,cAAG,UAAU,CAAC;AAC/B,uBAAuB;AAEvB,qCAAqC;AACrC;;;;;;KAMK;AACL,SAAgB,YAAY,CAAI,IAAY,EAAE,QAAkB;IAC5D,IAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,sBAAc,CAAC,+BAA+B,EAAE,IAAA,kBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,IAAI,GAAG,EAAc,CAAC;IAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KA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AACrC;;;;;;KAMK;AACL,SAAgB,eAAe;IAC3B,MAAM,MAAM,GAAG,EAA4B,CAAC;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC;QAC5B,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,KAAK,GAAG,CAAC,CAAC;QACd,CAAC;aACI,CAAC;YACF,KAAK,EAAE,CAAC;YACR,MAAM,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,uBAAuB;AACvB,IAAA,gCAAiB,EAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE;IAC1C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;SAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,UAAU,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import { Fnc } from "../index.types";
2
- /**
3
- * Wait deploy of a component
4
- *
5
- * @param {string} name - name of component
6
- * @param {function} callback - callback for creator of component, if it completes it, this callback will be called
7
- * */
8
- export declare function waitDeploy(name: string, callback: Fnc): void;
9
- /**
10
- * Complete deploy of a component
11
- * - It should be called by owner of component
12
- *
13
- *
14
- *
15
- * @param {string} name - name of component
16
- * @param {...Array} values - They will be sent to callback of waiting component, {@link waitDeploy}
17
- * */
18
- export declare function completeDeploy(name: string, ...values: Array<unknown>): void;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitDeploy = waitDeploy;
4
- exports.completeDeploy = completeDeploy;
5
- const function_1 = require("../function");
6
- const error_1 = require("../error");
7
- const internal_1 = require("../internal");
8
- const map_fn_1 = require("./map.fn");
9
- const test_fn_1 = require("./test.fn");
10
- // region properties
11
- const where = `${internal_1.FQN}.DeployFn`;
12
- const waitingCallbacks = (0, map_fn_1.newRepoMap)(`${where}.waitingCallbacks`);
13
- const alreadyDeployed = (0, map_fn_1.newRepoMap)(`${where}.alreadyDeployed`);
14
- // endregion properties
15
- // noinspection JSUnusedGlobalSymbols
16
- /**
17
- * Wait deploy of a component
18
- *
19
- * @param {string} name - name of component
20
- * @param {function} callback - callback for creator of component, if it completes it, this callback will be called
21
- * */
22
- function waitDeploy(name, callback) {
23
- if (!(0, function_1.isText)(name)) {
24
- throw new error_1.DeveloperError('Invalid component name', (0, test_fn_1.testCase)(internal_1.FQN, 120), where);
25
- }
26
- if (typeof callback !== 'function') {
27
- throw new error_1.DeveloperError(`Invalid caller callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 121), where);
28
- }
29
- if (alreadyDeployed.has(name)) {
30
- try {
31
- callback(...alreadyDeployed.get(name));
32
- }
33
- catch (e) {
34
- new error_1.DeveloperError(`Callback error during caller's callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 122), where).log(e);
35
- }
36
- return;
37
- }
38
- if (!waitingCallbacks.has(name)) {
39
- waitingCallbacks.set(name, []);
40
- }
41
- waitingCallbacks.get(name).push(callback);
42
- }
43
- // noinspection JSUnusedGlobalSymbols
44
- /**
45
- * Complete deploy of a component
46
- * - It should be called by owner of component
47
- *
48
- *
49
- *
50
- * @param {string} name - name of component
51
- * @param {...Array} values - They will be sent to callback of waiting component, {@link waitDeploy}
52
- * */
53
- function completeDeploy(name, ...values) {
54
- if (!(0, function_1.isText)(name)) {
55
- throw new error_1.DeveloperError('Invalid component name', (0, test_fn_1.testCase)(internal_1.FQN, 123), where);
56
- }
57
- const isNew = !alreadyDeployed.has(name);
58
- alreadyDeployed.set(name, values);
59
- if (isNew) {
60
- if (waitingCallbacks.has(name)) {
61
- const callbacks = waitingCallbacks.get(name);
62
- waitingCallbacks.delete(name);
63
- callbacks.forEach(callback => {
64
- try {
65
- callback(...values);
66
- }
67
- catch (e) {
68
- new error_1.DeveloperError(`Callback error during pending callback [${name}]`, (0, test_fn_1.testCase)(internal_1.FQN, 124), where).log(e);
69
- }
70
- });
71
- }
72
- }
73
- }
74
- //# sourceMappingURL=deploy.fn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.fn.js","sourceRoot":"","sources":["../../src/common/deploy.fn.ts"],"names":[],"mappings":";;AAoBA,gCAoBC;AAaD,wCAoBC;AAxED,0CAAmC;AACnC,oCAAwC;AACxC,0CAAgC;AAChC,qCAAoC;AACpC,uCAAmC;AAEnC,oBAAoB;AACpB,MAAM,KAAK,GAAG,GAAG,cAAG,WAAW,CAAC;AAChC,MAAM,gBAAgB,GAAG,IAAA,mBAAU,EAAqB,GAAG,KAAK,mBAAmB,CAAC,CAAC;AACrF,MAAM,eAAe,GAAG,IAAA,mBAAU,EAAyB,GAAG,KAAK,kBAAkB,CAAC,CAAC;AACvF,uBAAuB;AAEvB,qCAAqC;AACrC;;;;;KAKK;AACL,SAAgB,UAAU,CAAC,IAAY,EAAE,QAAa;IAClD,IAAK,CAAC,IAAA,iBAAM,EAAC,IAAI,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,sBAAc,CAAC,wBAAwB,EAAE,IAAA,kBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,IAAI,sBAAc,CAAC,4BAA4B,IAAI,GAAG,EAAE,IAAA,kBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CA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I,CAAC,CAAC;YAC9B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACzB,IAAI,CAAC;oBACD,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC;gBACxB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,IAAI,sBAAc,CAAC,2CAA2C,IAAI,GAAG,EAAE,IAAA,kBAAQ,EAAC,cAAG,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC7G,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -1,56 +0,0 @@
1
- import { EnumData, EnumInertEagerOpt, EnumInertItem, EnumInertLazyOpt } from "../index.types";
2
- /**
3
- * Define an enum
4
- *
5
- * @param {EnumData} data - enum map or literal
6
- * @param {string} name - enum name
7
- * @param {EnumInertEagerOpt} options - enum options
8
- * */
9
- export declare function defineEnum(data: EnumData, name: string, options: EnumInertEagerOpt): void;
10
- /**
11
- * Define an enum as lazy (with path)
12
- *
13
- * @param {EnumInertLazyOpt} options - enum options
14
- * */
15
- export declare function defineLazyEnum(options: EnumInertLazyOpt): void;
16
- /**
17
- * Check enum defined as lazy, by name
18
- * Note:
19
- * - Enum's mode will be shifted lazy to eager after loaded
20
- *
21
- * @param {string} name - enum name
22
- * @return {boolean}
23
- * */
24
- export declare function isEnumLazy(name: string): boolean;
25
- /**
26
- * Check enum defined as eager, by name
27
- *
28
- * @param {string} name - enum name
29
- * @return {boolean}
30
- * */
31
- export declare function isEnumEager(name: string): boolean;
32
- /**
33
- * Check enum defined or not, by name
34
- *
35
- * @param {string} name - enum name
36
- * @return {boolean}
37
- * */
38
- export declare function isEnumDefined(name: string): boolean;
39
- /**
40
- * Get enum by name
41
- * Note:
42
- * - Enum may be lazy mode, so it has lazy paths without class
43
- *
44
- * @param {string} name - enum name
45
- * @return {EnumItem}
46
- * */
47
- export declare function getEnum(name: string): EnumInertItem;
48
- /**
49
- * Load lazy enum by name
50
- * Note:
51
- * - Enum must be exported as `foretell`
52
- *
53
- * @param {string} name - name of enum
54
- * @return {Promise<EnumItem>}
55
- * */
56
- export declare function loadLazyEnum(name: string): Promise<EnumInertItem>;