@leyyo/common 1.3.7 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +32 -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,5 +1,5 @@
1
- import { LeyyoError } from "./leyyo.error";
2
- import { Opt } from "../function";
1
+ import { LeyyoError } from "./leyyo.error.js";
2
+ import { Opt } from "../function/index.js";
3
3
  /**
4
4
  * Caused error
5
5
  * */
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CausedError = void 0;
4
- const leyyo_error_1 = require("./leyyo.error");
1
+ import { LeyyoError } from "./leyyo.error.js";
5
2
  /**
6
3
  * Caused error
7
4
  * */
8
- class CausedError extends leyyo_error_1.LeyyoError {
5
+ export class CausedError extends LeyyoError {
9
6
  /**
10
7
  * Cast a native error to caused error
11
8
  *
@@ -20,5 +17,3 @@ class CausedError extends leyyo_error_1.LeyyoError {
20
17
  return err;
21
18
  }
22
19
  }
23
- exports.CausedError = CausedError;
24
- //# sourceMappingURL=caused.error.js.map
@@ -1,6 +1,6 @@
1
- import { KEY_SECURE_1 } from "../const";
2
- import { LeyyoLike } from "../base";
3
- import { DeveloperErrorLike, ErrorStackLine } from "./index.types";
1
+ import { KEY_SECURE_1 } from "../const/index.js";
2
+ import { LeyyoLike } from "../base/index.js";
3
+ import { DeveloperErrorLike, ErrorStackLine } from "./index.types.js";
4
4
  declare const LY_DEVELOPER_MESSAGE: unique symbol;
5
5
  declare const LY_DEVELOPER_CASE: unique symbol;
6
6
  declare const LY_DEVELOPER_WHERE: unique symbol;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeveloperError = void 0;
4
- const const_1 = require("../const");
1
+ import { KEY_SECURE_1 } from "../const/index.js";
5
2
  // region properties
6
3
  const LY_DEVELOPER_MESSAGE = Symbol.for('leyyo/developer.message');
7
4
  const LY_DEVELOPER_CASE = Symbol.for('leyyo/developer.case');
@@ -9,14 +6,19 @@ const LY_DEVELOPER_WHERE = Symbol.for('leyyo/developer.where');
9
6
  let _leyyo;
10
7
  // endregion properties
11
8
  /** Developer error */
12
- class DeveloperError extends Error {
9
+ export class DeveloperError extends Error {
10
+ [LY_DEVELOPER_MESSAGE];
11
+ [LY_DEVELOPER_CASE];
12
+ [LY_DEVELOPER_WHERE];
13
+ /** @inheritDoc */
14
+ stackTrace;
13
15
  /**
14
16
  * @param {string} message - error message
15
17
  * @param {string} issue - test case
16
18
  * @param {string} where - where
17
19
  * */
18
20
  constructor(message, issue, where) {
19
- message = message !== null && message !== void 0 ? message : 'Developer error';
21
+ message = message ?? 'Developer error';
20
22
  const pureMessage = message;
21
23
  if (typeof issue === 'string') {
22
24
  message += ` [case:${issue}]`;
@@ -34,7 +36,7 @@ class DeveloperError extends Error {
34
36
  }
35
37
  _leyyo.errorCommon.buildStack(this);
36
38
  }
37
- static [const_1.KEY_SECURE_1](leyyo) {
39
+ static [KEY_SECURE_1](leyyo) {
38
40
  if (!_leyyo) {
39
41
  _leyyo = leyyo;
40
42
  }
@@ -47,5 +49,3 @@ class DeveloperError extends Error {
47
49
  _leyyo.logCommon.emitLog('fatal', this[LY_DEVELOPER_WHERE], this, _leyyo.errorCommon.toJsonBasic(this, { testCase: this[LY_DEVELOPER_CASE] }));
48
50
  }
49
51
  }
50
- exports.DeveloperError = DeveloperError;
51
- //# sourceMappingURL=developer.error.js.map
@@ -1,5 +1,5 @@
1
- import { LeyyoError } from "./leyyo.error";
2
- import { Opt } from "../function";
1
+ import { LeyyoError } from "./leyyo.error.js";
2
+ import { Opt } from "../function/index.js";
3
3
  /**
4
4
  * Http error
5
5
  * */
@@ -1,13 +1,10 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.HttpError = void 0;
5
- const leyyo_error_1 = require("./leyyo.error");
6
- const const_1 = require("../const");
1
+ import { LeyyoError } from "./leyyo.error.js";
2
+ import { KEY_ERROR_DEFAULT_MESSAGE, KEY_ERROR_HTTP_STATUS } from "../const/index.js";
7
3
  /**
8
4
  * Http error
9
5
  * */
10
- class HttpError extends leyyo_error_1.LeyyoError {
6
+ export class HttpError extends LeyyoError {
7
+ status;
11
8
  /**
12
9
  * @param {(string|Opt)} p1 - error message or error parameters
13
10
  * @param {Opt?} p2 - error parameters
@@ -15,17 +12,14 @@ class HttpError extends leyyo_error_1.LeyyoError {
15
12
  constructor(p1, p2) {
16
13
  super(p1, p2);
17
14
  const clazz = this.constructor;
18
- if (Number.isSafeInteger(clazz[const_1.KEY_ERROR_HTTP_STATUS])) {
19
- this.status = clazz[const_1.KEY_ERROR_HTTP_STATUS];
15
+ if (Number.isSafeInteger(clazz[KEY_ERROR_HTTP_STATUS])) {
16
+ this.status = clazz[KEY_ERROR_HTTP_STATUS];
20
17
  }
21
18
  else {
22
19
  this.status = 400;
23
20
  }
24
21
  }
22
+ static {
23
+ this[KEY_ERROR_DEFAULT_MESSAGE] = 'Http error';
24
+ }
25
25
  }
26
- exports.HttpError = HttpError;
27
- _a = HttpError;
28
- (() => {
29
- _a[const_1.KEY_ERROR_DEFAULT_MESSAGE] = 'Http error';
30
- })();
31
- //# sourceMappingURL=http.error.js.map
@@ -1,7 +1,7 @@
1
- export * from './index.types';
2
- export * from './caused.error';
3
- export * from './developer.error';
4
- export * from './http.error';
5
- export * from './invalid-value.error';
6
- export * from './leyyo.error';
7
- export * from './multiple.error';
1
+ export * from './index.types.js';
2
+ export * from './caused.error.js';
3
+ export * from './developer.error.js';
4
+ export * from './http.error.js';
5
+ export * from './invalid-value.error.js';
6
+ export * from './leyyo.error.js';
7
+ export * from './multiple.error.js';
@@ -1,24 +1,7 @@
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
- __exportStar(require("./index.types"), exports);
18
- __exportStar(require("./caused.error"), exports);
19
- __exportStar(require("./developer.error"), exports);
20
- __exportStar(require("./http.error"), exports);
21
- __exportStar(require("./invalid-value.error"), exports);
22
- __exportStar(require("./leyyo.error"), exports);
23
- __exportStar(require("./multiple.error"), exports);
24
- //# sourceMappingURL=index.js.map
1
+ export * from './index.types.js';
2
+ export * from './caused.error.js';
3
+ export * from './developer.error.js';
4
+ export * from './http.error.js';
5
+ export * from './invalid-value.error.js';
6
+ export * from './leyyo.error.js';
7
+ export * from './multiple.error.js';
@@ -1,6 +1,6 @@
1
- import { ClassLike, Obj, OneOrMore, ShiftMain, ShiftSecure } from "../base";
2
- import { Opt } from "../function";
3
- import { Logger } from "../common";
1
+ import { ClassLike, Obj, OneOrMore, ShiftMain, ShiftSecure } from "../base/index.js";
2
+ import { Opt } from "../function/index.js";
3
+ import { Logger } from "../common/index.js";
4
4
  /**
5
5
  * {@link LeyyoError}
6
6
  * */
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { LeyyoError } from "./leyyo.error";
1
+ import { LeyyoError } from "./leyyo.error.js";
2
2
  /**
3
3
  * Invalid value error
4
4
  * */
@@ -1,17 +1,10 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.InvalidValueError = void 0;
5
- const leyyo_error_1 = require("./leyyo.error");
6
- const const_1 = require("../const");
1
+ import { LeyyoError } from "./leyyo.error.js";
2
+ import { KEY_ERROR_DEFAULT_MESSAGE } from "../const/index.js";
7
3
  /**
8
4
  * Invalid value error
9
5
  * */
10
- class InvalidValueError extends leyyo_error_1.LeyyoError {
6
+ export class InvalidValueError extends LeyyoError {
7
+ static {
8
+ this[KEY_ERROR_DEFAULT_MESSAGE] = 'Invalid value';
9
+ }
11
10
  }
12
- exports.InvalidValueError = InvalidValueError;
13
- _a = InvalidValueError;
14
- (() => {
15
- _a[const_1.KEY_ERROR_DEFAULT_MESSAGE] = 'Invalid value';
16
- })();
17
- //# sourceMappingURL=invalid-value.error.js.map
@@ -1,8 +1,8 @@
1
- import { Logger } from "../common";
2
- import { ErrorStackLine, LeyyoErrorLike, LeyyoErrorSecure, LeyyoErrorTag } from "./index.types";
3
- import { ClassLike, LeyyoLike, Obj, OneOrMore } from "../base";
4
- import { Opt } from "../function";
5
- import { KEY_ERROR_FLAGS, KEY_SECURE_1 } from "../const";
1
+ import { Logger } from "../common/index.js";
2
+ import { ErrorStackLine, LeyyoErrorLike, LeyyoErrorSecure, LeyyoErrorTag } from "./index.types.js";
3
+ import { ClassLike, LeyyoLike, Obj, OneOrMore } from "../base/index.js";
4
+ import { Opt } from "../function/index.js";
5
+ import { KEY_ERROR_FLAGS, KEY_SECURE_1 } from "../const/index.js";
6
6
  type T2 = LeyyoErrorTag;
7
7
  /**
8
8
  * Leyyo base error
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LeyyoError = void 0;
4
- const function_1 = require("../function");
5
- const const_1 = require("../const");
1
+ import { getFqn, getSymbol, isFilledObj, isObj, optAdd, optAppend, setSymbol } from "../function/index.js";
2
+ import { KEY_ERROR_FLAGS, KEY_ERROR_WHERE, KEY_SECURE_1, VAL_ERROR_UNKNOWN_MESSAGE } from "../const/index.js";
6
3
  let _leyyo;
7
4
  // region property
8
5
  const _errorField = ['name', 'message', 'stack'];
@@ -11,7 +8,23 @@ const _leyyoErrorFields = [..._errorField, 'params', 'causedBy', 'stackTrace'];
11
8
  /**
12
9
  * Leyyo base error
13
10
  * */
14
- class LeyyoError extends Error {
11
+ export class LeyyoError extends Error {
12
+ /**
13
+ * Error flags
14
+ * */
15
+ [KEY_ERROR_FLAGS];
16
+ /**
17
+ * Error parameters
18
+ * */
19
+ params;
20
+ /**
21
+ * Caused by error
22
+ * */
23
+ causedBy;
24
+ /**
25
+ * Stack trace
26
+ * */
27
+ stackTrace;
15
28
  /**
16
29
  * @param {(string|Opt)?} p1 - error message or error parameters
17
30
  * @param {Opt?} p2 - error parameters
@@ -24,23 +37,23 @@ class LeyyoError extends Error {
24
37
  params = p2;
25
38
  }
26
39
  else {
27
- message = const_1.VAL_ERROR_UNKNOWN_MESSAGE;
40
+ message = VAL_ERROR_UNKNOWN_MESSAGE;
28
41
  params = p1;
29
42
  }
30
43
  super(message);
31
44
  const clazz = this.constructor;
32
45
  if (!message) {
33
46
  const conf = _leyyo.errorCommon.getConfigItem(clazz);
34
- this.message = conf === null || conf === void 0 ? void 0 : conf.message;
47
+ this.message = conf?.message;
35
48
  }
36
49
  if (params && typeof params === 'object' && !Array.isArray(params)) {
37
50
  this.params = params;
38
51
  }
39
- this.name = (0, function_1.getFqn)(clazz);
52
+ this.name = getFqn(clazz);
40
53
  _leyyo.errorCommon.buildStack(this);
41
54
  _leyyo.errorCommon.emit(this);
42
55
  }
43
- static [const_1.KEY_SECURE_1](leyyo) {
56
+ static [KEY_SECURE_1](leyyo) {
44
57
  if (!_leyyo) {
45
58
  _leyyo = leyyo;
46
59
  }
@@ -65,10 +78,10 @@ class LeyyoError extends Error {
65
78
  }
66
79
  where(p1, fqn) {
67
80
  if (typeof p1 === 'function') {
68
- (0, function_1.setSymbol)(this, const_1.KEY_ERROR_WHERE, (0, function_1.getFqn)(p1));
81
+ setSymbol(this, KEY_ERROR_WHERE, getFqn(p1));
69
82
  }
70
83
  else if (p1 && typeof p1 === 'object') {
71
- (0, function_1.setSymbol)(this, const_1.KEY_ERROR_WHERE, (0, function_1.getFqn)(p1));
84
+ setSymbol(this, KEY_ERROR_WHERE, getFqn(p1));
72
85
  }
73
86
  else if (p1 && typeof p1 === 'string' && p1.trim()) {
74
87
  if (typeof fqn === 'string') {
@@ -78,7 +91,7 @@ class LeyyoError extends Error {
78
91
  else {
79
92
  fqn = '';
80
93
  }
81
- (0, function_1.setSymbol)(this, const_1.KEY_ERROR_WHERE, fqn + p1.trim());
94
+ setSymbol(this, KEY_ERROR_WHERE, fqn + p1.trim());
82
95
  }
83
96
  return this;
84
97
  }
@@ -121,42 +134,42 @@ class LeyyoError extends Error {
121
134
  // endregion log
122
135
  // region flags
123
136
  get $where() {
124
- return (0, function_1.getSymbol)(this, const_1.KEY_ERROR_WHERE);
137
+ return getSymbol(this, KEY_ERROR_WHERE);
125
138
  }
126
139
  $list() {
127
- if (this[const_1.KEY_ERROR_FLAGS] === undefined) {
140
+ if (this[KEY_ERROR_FLAGS] === undefined) {
128
141
  return [];
129
142
  }
130
- return Array.from(this[const_1.KEY_ERROR_FLAGS].values());
143
+ return Array.from(this[KEY_ERROR_FLAGS].values());
131
144
  }
132
145
  $append(key) {
133
- if (this[const_1.KEY_ERROR_FLAGS] === undefined) {
134
- this[const_1.KEY_ERROR_FLAGS] = new Set();
146
+ if (this[KEY_ERROR_FLAGS] === undefined) {
147
+ this[KEY_ERROR_FLAGS] = new Set();
135
148
  }
136
- else if (this[const_1.KEY_ERROR_FLAGS].has(key)) {
149
+ else if (this[KEY_ERROR_FLAGS].has(key)) {
137
150
  return false;
138
151
  }
139
- this[const_1.KEY_ERROR_FLAGS].add(key);
152
+ this[KEY_ERROR_FLAGS].add(key);
140
153
  return true;
141
154
  }
142
155
  $remove(key) {
143
- if (this[const_1.KEY_ERROR_FLAGS] === undefined) {
156
+ if (this[KEY_ERROR_FLAGS] === undefined) {
144
157
  return false;
145
158
  }
146
- if (!this[const_1.KEY_ERROR_FLAGS].has(key)) {
159
+ if (!this[KEY_ERROR_FLAGS].has(key)) {
147
160
  return false;
148
161
  }
149
- this[const_1.KEY_ERROR_FLAGS].delete(key);
150
- if (this[const_1.KEY_ERROR_FLAGS].size === 0) {
151
- delete this[const_1.KEY_ERROR_FLAGS];
162
+ this[KEY_ERROR_FLAGS].delete(key);
163
+ if (this[KEY_ERROR_FLAGS].size === 0) {
164
+ delete this[KEY_ERROR_FLAGS];
152
165
  }
153
166
  return true;
154
167
  }
155
168
  $has(key) {
156
- if (this[const_1.KEY_ERROR_FLAGS] === undefined) {
169
+ if (this[KEY_ERROR_FLAGS] === undefined) {
157
170
  return false;
158
171
  }
159
- return this[const_1.KEY_ERROR_FLAGS].has(key);
172
+ return this[KEY_ERROR_FLAGS].has(key);
160
173
  }
161
174
  // endregion flags
162
175
  // region methods
@@ -165,23 +178,23 @@ class LeyyoError extends Error {
165
178
  if (!(source instanceof Error)) {
166
179
  return;
167
180
  }
168
- if (!(0, function_1.isObj)(this.params)) {
181
+ if (!isObj(this.params)) {
169
182
  this.params = {};
170
183
  }
171
184
  if (source instanceof LeyyoError) {
172
185
  for (const [k, v] of Object.entries(source)) {
173
186
  if (!_leyyoErrorFields.includes(k) && (typeof k === 'string') && !['symbol', 'function', 'undefined'].includes(typeof v)) {
174
- (0, function_1.optAdd)(this.params, k, v);
187
+ optAdd(this.params, k, v);
175
188
  }
176
- if ((0, function_1.isFilledObj)(source.params)) {
177
- (0, function_1.optAppend)(this.params, source.params);
189
+ if (isFilledObj(source.params)) {
190
+ optAppend(this.params, source.params);
178
191
  }
179
192
  }
180
193
  }
181
194
  else {
182
195
  for (const [k, v] of Object.entries(source)) {
183
196
  if (!_errorField.includes(k) && (typeof k === 'string') && !['symbol', 'function', 'undefined'].includes(typeof v)) {
184
- (0, function_1.optAdd)(this.params, k, v);
197
+ optAdd(this.params, k, v);
185
198
  }
186
199
  }
187
200
  }
@@ -195,5 +208,3 @@ class LeyyoError extends Error {
195
208
  return this;
196
209
  }
197
210
  }
198
- exports.LeyyoError = LeyyoError;
199
- //# sourceMappingURL=leyyo.error.js.map
@@ -1,5 +1,5 @@
1
- import { LeyyoErrorLike } from "./index.types";
2
- import { LeyyoError } from "./leyyo.error";
1
+ import { LeyyoErrorLike } from "./index.types.js";
2
+ import { LeyyoError } from "./leyyo.error.js";
3
3
  /**
4
4
  * Multiple error which manages multiple errors
5
5
  * */
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultipleError = void 0;
4
- const leyyo_error_1 = require("./leyyo.error");
5
- const caused_error_1 = require("./caused.error");
1
+ import { LeyyoError } from "./leyyo.error.js";
2
+ import { CausedError } from "./caused.error.js";
6
3
  // noinspection Annotator
7
4
  /**
8
5
  * Multiple error which manages multiple errors
9
6
  * */
10
- class MultipleError extends leyyo_error_1.LeyyoError {
7
+ export class MultipleError extends LeyyoError {
11
8
  /**
12
9
  * @param {...Error[]} errors
13
10
  * */
14
11
  constructor(...errors) {
15
- var _a;
16
12
  const first = errors.length > 0 ? errors[0] : undefined;
17
- super((_a = first === null || first === void 0 ? void 0 : first.message) !== null && _a !== void 0 ? _a : 'Multiple error', {});
13
+ super(first?.message ?? 'Multiple error', {});
18
14
  this.causedBy = [];
19
15
  this.push(...errors);
20
16
  }
@@ -23,15 +19,13 @@ class MultipleError extends leyyo_error_1.LeyyoError {
23
19
  if (e instanceof MultipleError) {
24
20
  this.causedBy.push(...e.causedBy);
25
21
  }
26
- else if (e instanceof leyyo_error_1.LeyyoError) {
22
+ else if (e instanceof LeyyoError) {
27
23
  this.causedBy.push(e);
28
24
  }
29
25
  else {
30
- this.causedBy.push(caused_error_1.CausedError.of(e));
26
+ this.causedBy.push(CausedError.of(e));
31
27
  }
32
28
  });
33
29
  return this;
34
30
  }
35
31
  }
36
- exports.MultipleError = MultipleError;
37
- //# sourceMappingURL=multiple.error.js.map
@@ -1,4 +1,4 @@
1
- import { LoaderItem, LoaderLike } from "./index.types";
1
+ import { LoaderItem, LoaderLike } from "./index.types.js";
2
2
  /**
3
3
  * Set name of a loader
4
4
  *
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineLoader = defineLoader;
4
- const is_fn_1 = require("./is.fn");
5
- const const_1 = require("../const");
1
+ import { isFilledArr } from "./is-filled-arr.js";
2
+ import { isText } from "./is-text.js";
3
+ import { KEY_LOADER_NAME } from "../const/index.js";
6
4
  /**
7
5
  * Set name of a loader
8
6
  *
9
7
  * @param {string} fqn - component name
10
8
  * @param {...LoaderItem[]} items - items
11
9
  * */
12
- function defineLoader(fqn, ...items) {
13
- if (!(0, is_fn_1.isText)(fqn)) {
10
+ export function defineLoader(fqn, ...items) {
11
+ if (!isText(fqn)) {
14
12
  fqn = `leyyo/@${Date.now()}`;
15
13
  }
16
- if (!(0, is_fn_1.isFilledArr)(items)) {
14
+ if (!isFilledArr(items)) {
17
15
  items = [];
18
16
  }
19
17
  const loader = [...items];
20
- loader[const_1.KEY_LOADER_NAME] = fqn;
18
+ loader[KEY_LOADER_NAME] = fqn;
21
19
  return loader;
22
20
  }
23
- //# sourceMappingURL=define-loader.js.map
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.delay = delay;
4
1
  // noinspection JSUnusedGlobalSymbols
5
2
  /**
6
3
  * Delay or sleep n msec
@@ -10,13 +7,12 @@ exports.delay = delay;
10
7
  * @return {any}
11
8
  * @async
12
9
  * */
13
- function delay(waiting, response) {
10
+ export function delay(waiting, response) {
14
11
  if (typeof waiting !== "number" || waiting < 10) {
15
- waiting = Math.round(Math.random() * 1000);
12
+ waiting = Math.round(Math.random() * 1_000);
16
13
  }
17
14
  else if (!Number.isSafeInteger(waiting)) {
18
15
  waiting = Math.round(waiting);
19
16
  }
20
17
  return new Promise(() => setTimeout(() => response, waiting));
21
18
  }
22
- //# sourceMappingURL=delay.js.map
@@ -1,12 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteKey = deleteKey;
4
- exports.deleteSymbol = deleteSymbol;
5
- exports.deleteProp = deleteProp;
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
  * Delete target property
@@ -15,7 +10,7 @@ let _leyyo;
15
10
  * @param {string} key - key
16
11
  * @return {boolean} - is deleted?
17
12
  * */
18
- function deleteKey(target, key) {
13
+ export function deleteKey(target, key) {
19
14
  if (typeof key !== 'string') {
20
15
  return false;
21
16
  }
@@ -28,7 +23,7 @@ function deleteKey(target, key) {
28
23
  * @param {symbol} key - hidden key
29
24
  * @return {boolean} - is deleted?
30
25
  * */
31
- function deleteSymbol(target, key) {
26
+ export function deleteSymbol(target, key) {
32
27
  if (typeof key !== 'symbol') {
33
28
  return false;
34
29
  }
@@ -41,7 +36,7 @@ function deleteSymbol(target, key) {
41
36
  * @param {(symbol|string)} key - key
42
37
  * @return {boolean} - is deleted?
43
38
  * */
44
- function deleteProp(target, key) {
39
+ export function deleteProp(target, key) {
45
40
  if (!['symbol', 'string'].includes(typeof key)) {
46
41
  return false;
47
42
  }
@@ -67,10 +62,9 @@ function deleteProp(target, key) {
67
62
  }
68
63
  catch (e) {
69
64
  if (!_leyyo) {
70
- _leyyo = (0, leyyo_fn_1.$$get_leyyo_fn)();
65
+ _leyyo = $$get_leyyo_fn();
71
66
  }
72
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log(e);
67
+ new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
73
68
  return false;
74
69
  }
75
70
  }
76
- //# sourceMappingURL=delete-prop.js.map
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.emptyFn = emptyFn;
4
1
  // noinspection JSUnusedGlobalSymbols
5
2
  /**
6
3
  * Empty function, it can be more useful sometimes
@@ -8,6 +5,5 @@ exports.emptyFn = emptyFn;
8
5
  * @param {Arr} _args - insignificant parameters
9
6
  * @return {any}
10
7
  * */
11
- function emptyFn(..._args) {
8
+ export function emptyFn(..._args) {
12
9
  }
13
- //# sourceMappingURL=empty.fn.js.map
@@ -1,4 +1,4 @@
1
- import { ExtendedType } from "../base";
1
+ import { ExtendedType } from "../base/index.js";
2
2
  /**
3
3
  * Get extended type of value
4
4
  *