@leyyo/common 1.3.18 → 1.3.20

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 (84) hide show
  1. package/dist/base/index.d.ts +3 -3
  2. package/dist/base/index.js +3 -3
  3. package/dist/base/index.types.d.ts +3 -3
  4. package/dist/base/leyyo.js +1 -1
  5. package/dist/class/index.d.ts +2 -2
  6. package/dist/class/index.js +2 -2
  7. package/dist/class/logger.instance.d.ts +6 -6
  8. package/dist/class/logger.instance.js +11 -12
  9. package/dist/common/deploy.common.js +4 -4
  10. package/dist/common/enum.pool.d.ts +5 -3
  11. package/dist/common/enum.pool.js +16 -3
  12. package/dist/common/error.common.js +33 -29
  13. package/dist/common/error.pool.d.ts +1 -1
  14. package/dist/common/error.pool.js +2 -3
  15. package/dist/common/event.common.js +12 -9
  16. package/dist/common/index.d.ts +11 -11
  17. package/dist/common/index.js +11 -11
  18. package/dist/common/index.types.d.ts +18 -9
  19. package/dist/common/inert.d.ts +1 -1
  20. package/dist/common/inert.js +35 -35
  21. package/dist/common/lifecycle.common.js +13 -13
  22. package/dist/common/literal.pool.d.ts +1 -1
  23. package/dist/common/literal.pool.js +3 -3
  24. package/dist/common/log.common.js +68 -63
  25. package/dist/common/repo.common.js +23 -28
  26. package/dist/const/index.d.ts +0 -1
  27. package/dist/const/index.js +28 -29
  28. package/dist/enum/index.d.ts +1 -1
  29. package/dist/enum/index.js +1 -1
  30. package/dist/enum/log-level.d.ts +1 -1
  31. package/dist/enum/log-level.js +1 -1
  32. package/dist/error/developer.error.d.ts +1 -2
  33. package/dist/error/developer.error.js +6 -15
  34. package/dist/error/http.error.js +1 -1
  35. package/dist/error/index.d.ts +7 -7
  36. package/dist/error/index.js +7 -7
  37. package/dist/error/index.types.d.ts +1 -1
  38. package/dist/error/invalid-value.error.js +1 -1
  39. package/dist/error/leyyo.error.js +25 -21
  40. package/dist/error/multiple.error.js +2 -2
  41. package/dist/function/delete-prop.js +6 -6
  42. package/dist/function/empty-fn.js +1 -2
  43. package/dist/function/extended-type.js +18 -17
  44. package/dist/function/get-fqn.js +3 -2
  45. package/dist/function/get-prop.js +5 -5
  46. package/dist/function/get-stat.js +7 -2
  47. package/dist/function/has-fqn.js +3 -2
  48. package/dist/function/index.d.ts +40 -40
  49. package/dist/function/index.js +40 -40
  50. package/dist/function/index.types.d.ts +1 -1
  51. package/dist/function/is-anonymous-name.js +1 -1
  52. package/dist/function/is-class.js +2 -2
  53. package/dist/function/is-empty.js +1 -1
  54. package/dist/function/is-obj.js +1 -1
  55. package/dist/function/is-test.js +3 -5
  56. package/dist/function/is-text.js +1 -1
  57. package/dist/function/jitter-interval.js +2 -2
  58. package/dist/function/load-config.js +9 -9
  59. package/dist/function/on-fqn-set.js +4 -3
  60. package/dist/function/opt-add.js +2 -2
  61. package/dist/function/opt-check.js +2 -2
  62. package/dist/function/opt-field.js +6 -6
  63. package/dist/function/remove-fqn.js +3 -2
  64. package/dist/function/run-exporter.js +3 -3
  65. package/dist/function/secure-clone.js +3 -3
  66. package/dist/function/secure-json.js +12 -10
  67. package/dist/function/set-anonymous-fqn.js +5 -4
  68. package/dist/function/set-anonymous-name.js +14 -14
  69. package/dist/function/set-fqn.js +9 -8
  70. package/dist/function/set-prop.js +6 -6
  71. package/dist/function/stamp-loader.js +1 -1
  72. package/dist/function/test-case.js +3 -3
  73. package/dist/function/test-name.js +2 -2
  74. package/dist/function/trigger-fqn.js +2 -2
  75. package/dist/index.d.ts +10 -10
  76. package/dist/index.foretell.js +7 -7
  77. package/dist/index.js +10 -10
  78. package/dist/index.loader.js +3 -3
  79. package/dist/init/index.js +5 -7
  80. package/dist/sys/index.d.ts +2 -2
  81. package/dist/sys/index.js +2 -2
  82. package/dist/sys/leyyo-storage.js +5 -5
  83. package/dist/sys/package-json.js +5 -5
  84. package/package.json +16 -31
@@ -1,7 +1,7 @@
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
+ 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";
@@ -42,7 +42,7 @@ export interface DeveloperErrorCtor {
42
42
  * */
43
43
  new (message: string, issue?: string, where?: string): DeveloperErrorLike;
44
44
  }
45
- export type LeyyoErrorTag = 'printed' | 'sent';
45
+ export type LeyyoErrorTag = "printed" | "sent";
46
46
  /**
47
47
  * Stack line
48
48
  * */
@@ -5,6 +5,6 @@ import { KEY_ERROR_DEFAULT_MESSAGE } from "../const/index.js";
5
5
  * */
6
6
  export class InvalidValueError extends LeyyoError {
7
7
  static {
8
- this[KEY_ERROR_DEFAULT_MESSAGE] = 'Invalid value';
8
+ this[KEY_ERROR_DEFAULT_MESSAGE] = "Invalid value";
9
9
  }
10
10
  }
@@ -1,9 +1,9 @@
1
- import { getFqn, getSymbol, isFilledObj, isObj, optAdd, optAppend, setSymbol } from "../function/index.js";
2
- import { KEY_ERROR_FLAGS, KEY_ERROR_WHERE, KEY_LEYYO_SECURE, VAL_ERROR_UNKNOWN_MESSAGE } from "../const/index.js";
1
+ import { getFqn, getSymbol, isFilledObj, isObj, optAdd, optAppend, setSymbol, } from "../function/index.js";
2
+ import { KEY_ERROR_FLAGS, KEY_ERROR_WHERE, KEY_LEYYO_SECURE, VAL_ERROR_UNKNOWN_MESSAGE, } from "../const/index.js";
3
3
  let _leyyo;
4
4
  // region property
5
- const _errorField = ['name', 'message', 'stack'];
6
- const _leyyoErrorFields = [..._errorField, 'params', 'causedBy', 'stackTrace'];
5
+ const _errorField = ["name", "message", "stack"];
6
+ const _leyyoErrorFields = [..._errorField, "params", "causedBy", "stackTrace"];
7
7
  // endregion property
8
8
  /**
9
9
  * Leyyo base error
@@ -32,7 +32,7 @@ export class LeyyoError extends Error {
32
32
  constructor(p1, p2) {
33
33
  let message;
34
34
  let params;
35
- if (typeof p1 === 'string') {
35
+ if (typeof p1 === "string") {
36
36
  message = p1;
37
37
  params = p2;
38
38
  }
@@ -47,7 +47,7 @@ export class LeyyoError extends Error {
47
47
  const conf = _leyyo.errorCommon.getConfigItem(clazz);
48
48
  this.message = conf?.message;
49
49
  }
50
- if (params && typeof params === 'object' && !Array.isArray(params)) {
50
+ if (params && typeof params === "object" && !Array.isArray(params)) {
51
51
  this.params = params;
52
52
  }
53
53
  this.name = getFqn(clazz);
@@ -78,19 +78,19 @@ export class LeyyoError extends Error {
78
78
  return this;
79
79
  }
80
80
  where(p1, fqn) {
81
- if (typeof p1 === 'function') {
81
+ if (typeof p1 === "function") {
82
82
  setSymbol(this, KEY_ERROR_WHERE, getFqn(p1));
83
83
  }
84
- else if (p1 && typeof p1 === 'object') {
84
+ else if (p1 && typeof p1 === "object") {
85
85
  setSymbol(this, KEY_ERROR_WHERE, getFqn(p1));
86
86
  }
87
- else if (p1 && typeof p1 === 'string' && p1.trim()) {
88
- if (typeof fqn === 'string') {
87
+ else if (p1 && typeof p1 === "string" && p1.trim()) {
88
+ if (typeof fqn === "string") {
89
89
  fqn = fqn.trim();
90
- fqn = fqn ? `${fqn}.` : '';
90
+ fqn = fqn ? `${fqn}.` : "";
91
91
  }
92
92
  else {
93
- fqn = '';
93
+ fqn = "";
94
94
  }
95
95
  setSymbol(this, KEY_ERROR_WHERE, fqn + p1.trim());
96
96
  }
@@ -108,29 +108,29 @@ export class LeyyoError extends Error {
108
108
  }
109
109
  /** @inheritDoc */
110
110
  log(logger) {
111
- this._log('error', logger);
111
+ this._log("error", logger);
112
112
  }
113
113
  logFatal(logger) {
114
- this._log('fatal', logger);
114
+ this._log("fatal", logger);
115
115
  }
116
116
  logError(logger) {
117
- this._log('error', logger);
117
+ this._log("error", logger);
118
118
  }
119
119
  /** @inheritDoc */
120
120
  logWarn(logger) {
121
- this._log('warn', logger);
121
+ this._log("warn", logger);
122
122
  }
123
123
  /** @inheritDoc */
124
124
  logDebug(logger) {
125
- this._log('debug', logger);
125
+ this._log("debug", logger);
126
126
  }
127
127
  /** @inheritDoc */
128
128
  logInfo(logger) {
129
- this._log('info', logger);
129
+ this._log("info", logger);
130
130
  }
131
131
  /** @inheritDoc */
132
132
  logTrace(logger) {
133
- this._log('trace', logger);
133
+ this._log("trace", logger);
134
134
  }
135
135
  // endregion log
136
136
  // region flags
@@ -184,7 +184,9 @@ export class LeyyoError extends Error {
184
184
  }
185
185
  if (source instanceof LeyyoError) {
186
186
  for (const [k, v] of Object.entries(source)) {
187
- if (!_leyyoErrorFields.includes(k) && (typeof k === 'string') && !['symbol', 'function', 'undefined'].includes(typeof v)) {
187
+ if (!_leyyoErrorFields.includes(k) &&
188
+ typeof k === "string" &&
189
+ !["symbol", "function", "undefined"].includes(typeof v)) {
188
190
  optAdd(this.params, k, v);
189
191
  }
190
192
  if (isFilledObj(source.params)) {
@@ -194,7 +196,9 @@ export class LeyyoError extends Error {
194
196
  }
195
197
  else {
196
198
  for (const [k, v] of Object.entries(source)) {
197
- if (!_errorField.includes(k) && (typeof k === 'string') && !['symbol', 'function', 'undefined'].includes(typeof v)) {
199
+ if (!_errorField.includes(k) &&
200
+ typeof k === "string" &&
201
+ !["symbol", "function", "undefined"].includes(typeof v)) {
198
202
  optAdd(this.params, k, v);
199
203
  }
200
204
  }
@@ -10,12 +10,12 @@ export class MultipleError extends LeyyoError {
10
10
  * */
11
11
  constructor(...errors) {
12
12
  const first = errors.length > 0 ? errors[0] : undefined;
13
- super(first?.message ?? 'Multiple error', {});
13
+ super(first?.message ?? "Multiple error", {});
14
14
  this.causedBy = [];
15
15
  this.push(...errors);
16
16
  }
17
17
  push(...errors) {
18
- errors.forEach(e => {
18
+ errors.forEach((e) => {
19
19
  if (e instanceof MultipleError) {
20
20
  this.causedBy.push(...e.causedBy);
21
21
  }
@@ -11,7 +11,7 @@ let _leyyo;
11
11
  * @return {boolean} - is deleted?
12
12
  * */
13
13
  export function deleteKey(target, key) {
14
- if (typeof key !== 'string') {
14
+ if (typeof key !== "string") {
15
15
  return false;
16
16
  }
17
17
  return deleteProp(target, key);
@@ -24,7 +24,7 @@ export function deleteKey(target, key) {
24
24
  * @return {boolean} - is deleted?
25
25
  * */
26
26
  export function deleteSymbol(target, key) {
27
- if (typeof key !== 'symbol') {
27
+ if (typeof key !== "symbol") {
28
28
  return false;
29
29
  }
30
30
  return deleteProp(target, key);
@@ -37,10 +37,10 @@ export function deleteSymbol(target, key) {
37
37
  * @return {boolean} - is deleted?
38
38
  * */
39
39
  export function deleteProp(target, key) {
40
- if (!['symbol', 'string'].includes(typeof key)) {
40
+ if (!["symbol", "string"].includes(typeof key)) {
41
41
  return false;
42
42
  }
43
- if (!target || !['object', 'function'].includes(typeof target)) {
43
+ if (!target || !["object", "function"].includes(typeof target)) {
44
44
  return false;
45
45
  }
46
46
  try {
@@ -55,7 +55,7 @@ export function deleteProp(target, key) {
55
55
  value: undefined,
56
56
  configurable: true,
57
57
  writable: false,
58
- enumerable: typeof key === 'string',
58
+ enumerable: typeof key === "string",
59
59
  });
60
60
  delete target[key];
61
61
  return true;
@@ -64,7 +64,7 @@ export function deleteProp(target, key) {
64
64
  if (!_leyyo) {
65
65
  _leyyo = $$get_leyyo_fn();
66
66
  }
67
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
67
+ new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, "ZZZ"), where).log(e);
68
68
  return false;
69
69
  }
70
70
  }
@@ -5,5 +5,4 @@
5
5
  * @param {Arr} _args - insignificant parameters
6
6
  * @return {any}
7
7
  * */
8
- export function emptyFn(..._args) {
9
- }
8
+ export function emptyFn(..._args) { }
@@ -9,46 +9,47 @@ import { isClass } from "./is-class.js";
9
9
  * @return {ExtendedType}
10
10
  * */
11
11
  export function extendedType(value) {
12
+ let trimmed;
12
13
  switch (typeof value) {
13
14
  case "string":
14
- const trimmed = value.trim();
15
+ trimmed = value.trim();
15
16
  if (!trimmed) {
16
- return 'empty';
17
+ return "empty";
17
18
  }
18
19
  else if (trimmed === value) {
19
- return 'text';
20
+ return "text";
20
21
  }
21
- return 'string';
22
- case 'number':
22
+ return "string";
23
+ case "number":
23
24
  if (isNaN(value)) {
24
- return 'nan';
25
+ return "nan";
25
26
  }
26
- return Number.isInteger(value) ? 'integer' : 'number';
27
- case 'object':
27
+ return Number.isInteger(value) ? "integer" : "number";
28
+ case "object":
28
29
  if (!value) {
29
- return 'null';
30
+ return "null";
30
31
  }
31
32
  if (Array.isArray(value)) {
32
33
  if (value[KEY_LITERAL_NAME]) {
33
- return 'literal-items';
34
+ return "literal-items";
34
35
  }
35
- return (value instanceof List) ? 'list' : 'array';
36
+ return value instanceof List ? "list" : "array";
36
37
  }
37
38
  if (value instanceof Date) {
38
- return 'date';
39
+ return "date";
39
40
  }
40
41
  if (value instanceof Map) {
41
- return 'map';
42
+ return "map";
42
43
  }
43
44
  if (value instanceof Set) {
44
- return 'set';
45
+ return "set";
45
46
  }
46
47
  if (value[KEY_ENUM_NAME]) {
47
- return 'enum-map';
48
+ return "enum-map";
48
49
  }
49
- return 'object';
50
+ return "object";
50
51
  case "function":
51
- return isClass(value) ? 'class' : 'function';
52
+ return isClass(value) ? "class" : "function";
52
53
  default:
53
54
  return typeof value;
54
55
  }
@@ -9,10 +9,11 @@ export function getFqn(target) {
9
9
  if (!target) {
10
10
  return undefined;
11
11
  }
12
- if (typeof target === 'function') { // function, class
12
+ if (typeof target === "function") {
13
+ // function, class
13
14
  return target[KEY_FQN_NAME] ?? target.name;
14
15
  }
15
- else if (typeof target === 'object') {
16
+ else if (typeof target === "object") {
16
17
  if (Array.isArray(target)) {
17
18
  if (target[KEY_LITERAL_NAME]) {
18
19
  return target[KEY_FQN_NAME] ?? target[KEY_LITERAL_NAME];
@@ -11,7 +11,7 @@ let _leyyo;
11
11
  * @return {any}
12
12
  * */
13
13
  export function getKey(target, key) {
14
- if (typeof key !== 'string') {
14
+ if (typeof key !== "string") {
15
15
  return undefined;
16
16
  }
17
17
  return getProp(target, key);
@@ -24,7 +24,7 @@ export function getKey(target, key) {
24
24
  * @return {any}
25
25
  * */
26
26
  export function getSymbol(target, key) {
27
- if (typeof key !== 'symbol') {
27
+ if (typeof key !== "symbol") {
28
28
  return undefined;
29
29
  }
30
30
  return getProp(target, key);
@@ -37,10 +37,10 @@ export function getSymbol(target, key) {
37
37
  * @return {any}
38
38
  * */
39
39
  export function getProp(target, key) {
40
- if (!['symbol', 'string'].includes(typeof key)) {
40
+ if (!["symbol", "string"].includes(typeof key)) {
41
41
  return undefined;
42
42
  }
43
- if (!target || !['object', 'function'].includes(typeof target)) {
43
+ if (!target || !["object", "function"].includes(typeof target)) {
44
44
  return undefined;
45
45
  }
46
46
  try {
@@ -51,7 +51,7 @@ export function getProp(target, key) {
51
51
  if (!_leyyo) {
52
52
  _leyyo = $$get_leyyo_fn();
53
53
  }
54
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
54
+ new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, "ZZZ"), where).log(e);
55
55
  return undefined;
56
56
  }
57
57
  }
@@ -6,8 +6,13 @@ export function getStat() {
6
6
  memory: process.memoryUsage(),
7
7
  time: { uptime, startedAt: Date.now() - uptime },
8
8
  npm: { pwd: process.env.PWD, version: process.env.npm_config_npm_version },
9
- node: { type: 'module', version: process.env.npm_config_node_version },
10
- project: { name: process.env.npm_package_name, version: process.env.npm_package_version, environment: process.env.NODE_ENV, log: process.env.LOG_LEVEL },
9
+ node: { type: "module", version: process.env.npm_config_node_version },
10
+ project: {
11
+ name: process.env.npm_package_name,
12
+ version: process.env.npm_package_version,
13
+ environment: process.env.NODE_ENV,
14
+ log: process.env.LOG_LEVEL,
15
+ },
11
16
  os: {
12
17
  version: os.version(),
13
18
  arch: os.arch(),
@@ -9,10 +9,11 @@ export function hasFqn(target) {
9
9
  if (!target) {
10
10
  return false;
11
11
  }
12
- if (typeof target === 'function') { // function, class
12
+ if (typeof target === "function") {
13
+ // function, class
13
14
  return !!target[KEY_FQN_NAME];
14
15
  }
15
- else if (typeof target === 'object') {
16
+ else if (typeof target === "object") {
16
17
  if (Array.isArray(target)) {
17
18
  if (target[KEY_LITERAL_NAME]) {
18
19
  return !!target[KEY_FQN_NAME];
@@ -1,40 +1,40 @@
1
- export * from './index.types.js';
2
- export * from './define-loader.js';
3
- export * from './delay.js';
4
- export * from './delete-prop.js';
5
- export * from './empty-fn.js';
6
- export * from './extended-type.js';
7
- export * from './get-fqn.js';
8
- export * from './get-stat.js';
9
- export * from './set-fqn.js';
10
- export * from './remove-fqn.js';
11
- export * from './on-fqn-set.js';
12
- export * from './set-anonymous-fqn.js';
13
- export * from './get-prop.js';
14
- export * from './has-fqn.js';
15
- export * from './is-class.js';
16
- export * from './is-empty.js';
17
- export * from './is-filled-arr.js';
18
- export * from './is-filled-obj.js';
19
- export * from './is-obj.js';
20
- export * from './is-text.js';
21
- export * from './is-anonymous-name.js';
22
- export * from './jitter-interval.js';
23
- export * from './load-config.js';
24
- export * from './stamp-loader.js';
25
- export * from './one-or-more.js';
26
- export * from './opt-add.js';
27
- export * from './opt-append.js';
28
- export * from './opt-check.js';
29
- export * from './opt-clone.js';
30
- export * from './opt-field.js';
31
- export * from './opt-fn.js';
32
- export * from './run-exporter.js';
33
- export * from './secure-clone.js';
34
- export * from './secure-json.js';
35
- export * from './set-anonymous-name.js';
36
- export * from './set-prop.js';
37
- export * from './test-case.js';
38
- export * from './test-name.js';
39
- export * from './random-test-no.js';
40
- export * from './is-test.js';
1
+ export * from "./index.types.js";
2
+ export * from "./define-loader.js";
3
+ export * from "./delay.js";
4
+ export * from "./delete-prop.js";
5
+ export * from "./empty-fn.js";
6
+ export * from "./extended-type.js";
7
+ export * from "./get-fqn.js";
8
+ export * from "./get-stat.js";
9
+ export * from "./set-fqn.js";
10
+ export * from "./remove-fqn.js";
11
+ export * from "./on-fqn-set.js";
12
+ export * from "./set-anonymous-fqn.js";
13
+ export * from "./get-prop.js";
14
+ export * from "./has-fqn.js";
15
+ export * from "./is-class.js";
16
+ export * from "./is-empty.js";
17
+ export * from "./is-filled-arr.js";
18
+ export * from "./is-filled-obj.js";
19
+ export * from "./is-obj.js";
20
+ export * from "./is-text.js";
21
+ export * from "./is-anonymous-name.js";
22
+ export * from "./jitter-interval.js";
23
+ export * from "./load-config.js";
24
+ export * from "./stamp-loader.js";
25
+ export * from "./one-or-more.js";
26
+ export * from "./opt-add.js";
27
+ export * from "./opt-append.js";
28
+ export * from "./opt-check.js";
29
+ export * from "./opt-clone.js";
30
+ export * from "./opt-field.js";
31
+ export * from "./opt-fn.js";
32
+ export * from "./run-exporter.js";
33
+ export * from "./secure-clone.js";
34
+ export * from "./secure-json.js";
35
+ export * from "./set-anonymous-name.js";
36
+ export * from "./set-prop.js";
37
+ export * from "./test-case.js";
38
+ export * from "./test-name.js";
39
+ export * from "./random-test-no.js";
40
+ export * from "./is-test.js";
@@ -1,40 +1,40 @@
1
- export * from './index.types.js';
2
- export * from './define-loader.js';
3
- export * from './delay.js';
4
- export * from './delete-prop.js';
5
- export * from './empty-fn.js';
6
- export * from './extended-type.js';
7
- export * from './get-fqn.js';
8
- export * from './get-stat.js';
9
- export * from './set-fqn.js';
10
- export * from './remove-fqn.js';
11
- export * from './on-fqn-set.js';
12
- export * from './set-anonymous-fqn.js';
13
- export * from './get-prop.js';
14
- export * from './has-fqn.js';
15
- export * from './is-class.js';
16
- export * from './is-empty.js';
17
- export * from './is-filled-arr.js';
18
- export * from './is-filled-obj.js';
19
- export * from './is-obj.js';
20
- export * from './is-text.js';
21
- export * from './is-anonymous-name.js';
22
- export * from './jitter-interval.js';
23
- export * from './load-config.js';
24
- export * from './stamp-loader.js';
25
- export * from './one-or-more.js';
26
- export * from './opt-add.js';
27
- export * from './opt-append.js';
28
- export * from './opt-check.js';
29
- export * from './opt-clone.js';
30
- export * from './opt-field.js';
31
- export * from './opt-fn.js';
32
- export * from './run-exporter.js';
33
- export * from './secure-clone.js';
34
- export * from './secure-json.js';
35
- export * from './set-anonymous-name.js';
36
- export * from './set-prop.js';
37
- export * from './test-case.js';
38
- export * from './test-name.js';
39
- export * from './random-test-no.js';
40
- export * from './is-test.js';
1
+ export * from "./index.types.js";
2
+ export * from "./define-loader.js";
3
+ export * from "./delay.js";
4
+ export * from "./delete-prop.js";
5
+ export * from "./empty-fn.js";
6
+ export * from "./extended-type.js";
7
+ export * from "./get-fqn.js";
8
+ export * from "./get-stat.js";
9
+ export * from "./set-fqn.js";
10
+ export * from "./remove-fqn.js";
11
+ export * from "./on-fqn-set.js";
12
+ export * from "./set-anonymous-fqn.js";
13
+ export * from "./get-prop.js";
14
+ export * from "./has-fqn.js";
15
+ export * from "./is-class.js";
16
+ export * from "./is-empty.js";
17
+ export * from "./is-filled-arr.js";
18
+ export * from "./is-filled-obj.js";
19
+ export * from "./is-obj.js";
20
+ export * from "./is-text.js";
21
+ export * from "./is-anonymous-name.js";
22
+ export * from "./jitter-interval.js";
23
+ export * from "./load-config.js";
24
+ export * from "./stamp-loader.js";
25
+ export * from "./one-or-more.js";
26
+ export * from "./opt-add.js";
27
+ export * from "./opt-append.js";
28
+ export * from "./opt-check.js";
29
+ export * from "./opt-clone.js";
30
+ export * from "./opt-field.js";
31
+ export * from "./opt-fn.js";
32
+ export * from "./run-exporter.js";
33
+ export * from "./secure-clone.js";
34
+ export * from "./secure-json.js";
35
+ export * from "./set-anonymous-name.js";
36
+ export * from "./set-prop.js";
37
+ export * from "./test-case.js";
38
+ export * from "./test-name.js";
39
+ export * from "./random-test-no.js";
40
+ export * from "./is-test.js";
@@ -6,7 +6,7 @@ export type LoaderLike = Array<LoaderItem>;
6
6
  export type LeyyoStampLambda = () => LoaderItem;
7
7
  export type LeyyoStampEmpty = () => symbol;
8
8
  export type LoaderItem = ClassLike | Fnc | Enum | Literal | Obj | LeyyoStampLambda | LeyyoStampEmpty | LoaderLike;
9
- export type OptReason = 'invalid' | 'unexpected' | 'not:allowed' | 'not:found' | 'duplicated' | 'empty' | 'conflicted';
9
+ export type OptReason = "invalid" | "unexpected" | "not:allowed" | "not:found" | "duplicated" | "empty" | "conflicted";
10
10
  export interface Opt<R extends string = string> extends Obj {
11
11
  issue?: SetOrMore<OptReason | R | string>;
12
12
  message?: SetOrMore<string>;
@@ -1,6 +1,6 @@
1
1
  import { VAL_NAME_ANONYMOUS } from "../const/index.js";
2
2
  export function isAnonymousName(name) {
3
- if (typeof name === 'string') {
3
+ if (typeof name === "string") {
4
4
  return name.trim().startsWith(VAL_NAME_ANONYMOUS);
5
5
  }
6
6
  return false;
@@ -5,11 +5,11 @@
5
5
  * @return {boolean} - is class?
6
6
  * */
7
7
  export function isClass(fn) {
8
- if (typeof fn !== 'function') {
8
+ if (typeof fn !== "function") {
9
9
  return false;
10
10
  }
11
11
  try {
12
- return Function.prototype.toString.call(fn).toString().startsWith('class ');
12
+ return Function.prototype.toString.call(fn).toString().startsWith("class ");
13
13
  }
14
14
  catch (e) {
15
15
  return false;
@@ -14,5 +14,5 @@ export function isEmpty(value, notSpace) {
14
14
  if (notSpace) {
15
15
  return EMPTY_VALUES.includes(value);
16
16
  }
17
- return EMPTY_VALUES.includes(value) || (typeof value === 'string' && !value.trim());
17
+ return EMPTY_VALUES.includes(value) || (typeof value === "string" && !value.trim());
18
18
  }
@@ -7,5 +7,5 @@
7
7
  * @return {boolean} - is bare object?
8
8
  * */
9
9
  export function isObj(obj) {
10
- return obj && typeof obj === 'object' && !Array.isArray(obj);
10
+ return obj && typeof obj === "object" && !Array.isArray(obj);
11
11
  }
@@ -13,11 +13,9 @@ export function initTest() {
13
13
  if (global) {
14
14
  if (!global.leyyo_is_testing) {
15
15
  global.leyyo_is_testing = true;
16
- ['log', 'warn', 'info', 'debug', 'trace', 'error', 'fatal'].forEach(name => {
17
- global.console[name] = () => {
18
- };
19
- console[name] = () => {
20
- };
16
+ ["log", "warn", "info", "debug", "trace", "error", "fatal"].forEach((name) => {
17
+ global.console[name] = () => { };
18
+ console[name] = () => { };
21
19
  });
22
20
  }
23
21
  }
@@ -9,7 +9,7 @@
9
9
  * @return {boolean} - is text?
10
10
  * */
11
11
  export function isText(str) {
12
- if (typeof str !== 'string') {
12
+ if (typeof str !== "string") {
13
13
  return false;
14
14
  }
15
15
  const val = str.trim();
@@ -9,7 +9,7 @@
9
9
  * @return {number} - next interval time if (maxTryCount && `tryCount` >= `maxTryCount`)
10
10
  * */
11
11
  export function jitterInterval(tryCount, baseDelay, maxDelay, maxTryCount) {
12
- if ([tryCount, baseDelay, maxDelay].some(v => !isValid(v))) {
12
+ if ([tryCount, baseDelay, maxDelay].some((v) => !isValid(v))) {
13
13
  return undefined;
14
14
  }
15
15
  if (isValid(maxTryCount) && tryCount >= maxTryCount) {
@@ -26,5 +26,5 @@ export function jitterInterval(tryCount, baseDelay, maxDelay, maxTryCount) {
26
26
  * @return {boolean} - is it expected?
27
27
  * */
28
28
  function isValid(value) {
29
- return typeof value === 'number' && value > 0 && Number.isInteger(value) && Number.isSafeInteger(value);
29
+ return (typeof value === "number" && value > 0 && Number.isInteger(value) && Number.isSafeInteger(value));
30
30
  }