@leyyo/common 1.3.17 → 1.3.19

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 (146) 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 -70
  4. package/dist/base/index.types.js +0 -32
  5. package/dist/base/leyyo.d.ts +0 -3
  6. package/dist/base/leyyo.js +12 -23
  7. package/dist/class/index.d.ts +2 -2
  8. package/dist/class/index.js +2 -2
  9. package/dist/class/index.types.d.ts +0 -20
  10. package/dist/class/list.d.ts +0 -6
  11. package/dist/class/list.js +0 -6
  12. package/dist/class/logger.instance.d.ts +8 -13
  13. package/dist/class/logger.instance.js +13 -27
  14. package/dist/common/deploy.common.d.ts +0 -16
  15. package/dist/common/deploy.common.js +4 -21
  16. package/dist/common/enum.pool.d.ts +5 -13
  17. package/dist/common/enum.pool.js +16 -17
  18. package/dist/common/error.common.d.ts +0 -30
  19. package/dist/common/error.common.js +33 -69
  20. package/dist/common/error.pool.d.ts +1 -10
  21. package/dist/common/error.pool.js +2 -13
  22. package/dist/common/event.common.d.ts +0 -8
  23. package/dist/common/event.common.js +15 -25
  24. package/dist/common/index.d.ts +11 -11
  25. package/dist/common/index.js +11 -11
  26. package/dist/common/index.types.d.ts +12 -435
  27. package/dist/common/index.types.js +0 -1
  28. package/dist/common/inert.d.ts +1 -49
  29. package/dist/common/inert.js +35 -64
  30. package/dist/common/lifecycle.common.d.ts +0 -14
  31. package/dist/common/lifecycle.common.js +13 -29
  32. package/dist/common/literal.pool.d.ts +1 -12
  33. package/dist/common/literal.pool.js +3 -18
  34. package/dist/common/log.common.d.ts +0 -54
  35. package/dist/common/log.common.js +62 -147
  36. package/dist/common/repo.common.d.ts +0 -188
  37. package/dist/common/repo.common.js +23 -239
  38. package/dist/const/index.d.ts +8 -12
  39. package/dist/const/index.js +28 -33
  40. package/dist/enum/index.d.ts +1 -1
  41. package/dist/enum/index.js +1 -1
  42. package/dist/enum/log-level.d.ts +1 -4
  43. package/dist/enum/log-level.js +1 -1
  44. package/dist/error/caused.error.d.ts +0 -10
  45. package/dist/error/caused.error.js +0 -10
  46. package/dist/error/developer.error.d.ts +4 -17
  47. package/dist/error/developer.error.js +11 -33
  48. package/dist/error/http.error.d.ts +0 -13
  49. package/dist/error/http.error.js +1 -8
  50. package/dist/error/index.d.ts +7 -7
  51. package/dist/error/index.js +7 -7
  52. package/dist/error/index.types.d.ts +1 -150
  53. package/dist/error/invalid-value.error.d.ts +0 -3
  54. package/dist/error/invalid-value.error.js +1 -4
  55. package/dist/error/leyyo.error.d.ts +2 -35
  56. package/dist/error/leyyo.error.js +26 -58
  57. package/dist/error/multiple.error.d.ts +0 -6
  58. package/dist/error/multiple.error.js +2 -9
  59. package/dist/function/define-loader.d.ts +0 -6
  60. package/dist/function/define-loader.js +0 -6
  61. package/dist/function/delay.d.ts +0 -8
  62. package/dist/function/delay.js +0 -9
  63. package/dist/function/delete-prop.d.ts +0 -21
  64. package/dist/function/delete-prop.js +6 -28
  65. package/dist/function/empty-fn.d.ts +0 -6
  66. package/dist/function/empty-fn.js +1 -9
  67. package/dist/function/extended-type.d.ts +0 -6
  68. package/dist/function/extended-type.js +18 -24
  69. package/dist/function/get-fqn.d.ts +0 -6
  70. package/dist/function/get-fqn.js +2 -8
  71. package/dist/function/get-prop.d.ts +0 -21
  72. package/dist/function/get-prop.js +5 -26
  73. package/dist/function/get-stat.d.ts +0 -20
  74. package/dist/function/get-stat.js +7 -2
  75. package/dist/function/has-fqn.d.ts +0 -6
  76. package/dist/function/has-fqn.js +2 -8
  77. package/dist/function/index.d.ts +40 -40
  78. package/dist/function/index.js +40 -40
  79. package/dist/function/index.types.d.ts +1 -1
  80. package/dist/function/is-anonymous-name.js +1 -1
  81. package/dist/function/is-class.d.ts +0 -6
  82. package/dist/function/is-class.js +2 -20
  83. package/dist/function/is-empty.d.ts +0 -11
  84. package/dist/function/is-empty.js +1 -12
  85. package/dist/function/is-filled-arr.d.ts +0 -9
  86. package/dist/function/is-filled-arr.js +0 -9
  87. package/dist/function/is-filled-obj.d.ts +0 -9
  88. package/dist/function/is-filled-obj.js +0 -9
  89. package/dist/function/is-obj.d.ts +0 -8
  90. package/dist/function/is-obj.js +1 -9
  91. package/dist/function/is-test.d.ts +0 -8
  92. package/dist/function/is-test.js +3 -19
  93. package/dist/function/is-text.d.ts +0 -10
  94. package/dist/function/is-text.js +1 -11
  95. package/dist/function/jitter-interval.d.ts +0 -9
  96. package/dist/function/jitter-interval.js +2 -18
  97. package/dist/function/load-config.d.ts +0 -19
  98. package/dist/function/load-config.js +10 -61
  99. package/dist/function/on-fqn-set.js +3 -3
  100. package/dist/function/one-or-more.d.ts +0 -6
  101. package/dist/function/one-or-more.js +0 -7
  102. package/dist/function/opt-add.d.ts +0 -8
  103. package/dist/function/opt-add.js +2 -10
  104. package/dist/function/opt-append.d.ts +0 -7
  105. package/dist/function/opt-append.js +0 -7
  106. package/dist/function/opt-check.d.ts +0 -6
  107. package/dist/function/opt-check.js +2 -9
  108. package/dist/function/opt-clone.d.ts +0 -6
  109. package/dist/function/opt-clone.js +0 -7
  110. package/dist/function/opt-field.d.ts +0 -8
  111. package/dist/function/opt-field.js +6 -14
  112. package/dist/function/opt-fn.d.ts +0 -6
  113. package/dist/function/opt-fn.js +0 -7
  114. package/dist/function/random-test-no.d.ts +0 -5
  115. package/dist/function/random-test-no.js +0 -5
  116. package/dist/function/remove-fqn.d.ts +0 -8
  117. package/dist/function/remove-fqn.js +3 -12
  118. package/dist/function/run-exporter.d.ts +0 -5
  119. package/dist/function/run-exporter.js +3 -17
  120. package/dist/function/secure-clone.js +3 -3
  121. package/dist/function/secure-json.d.ts +0 -35
  122. package/dist/function/secure-json.js +12 -54
  123. package/dist/function/set-anonymous-fqn.js +4 -5
  124. package/dist/function/set-anonymous-name.js +14 -14
  125. package/dist/function/set-fqn.d.ts +0 -7
  126. package/dist/function/set-fqn.js +8 -15
  127. package/dist/function/set-prop.d.ts +0 -24
  128. package/dist/function/set-prop.js +6 -30
  129. package/dist/function/stamp-loader.d.ts +0 -6
  130. package/dist/function/stamp-loader.js +1 -7
  131. package/dist/function/test-case.d.ts +0 -7
  132. package/dist/function/test-case.js +3 -10
  133. package/dist/function/test-name.d.ts +0 -7
  134. package/dist/function/test-name.js +2 -9
  135. package/dist/function/trigger-fqn.js +2 -3
  136. package/dist/index.d.ts +10 -10
  137. package/dist/index.foretell.js +7 -10
  138. package/dist/index.js +10 -11
  139. package/dist/index.loader.js +1 -8
  140. package/dist/init/index.js +5 -7
  141. package/dist/sys/index.d.ts +2 -2
  142. package/dist/sys/index.js +2 -2
  143. package/dist/sys/leyyo-storage.d.ts +0 -7
  144. package/dist/sys/leyyo-storage.js +5 -28
  145. package/dist/sys/package-json.js +5 -5
  146. package/package.json +16 -31
@@ -3,44 +3,23 @@ import { testCase } from "./test-case.js";
3
3
  import { $$get_leyyo_fn } from "./leyyo-fn.js";
4
4
  const where = `${FQN}.DeleteProp`;
5
5
  let _leyyo;
6
- /**
7
- * Delete target property
8
- *
9
- * @param {any} target - target
10
- * @param {string} key - key
11
- * @return {boolean} - is deleted?
12
- * */
13
6
  export function deleteKey(target, key) {
14
- if (typeof key !== 'string') {
7
+ if (typeof key !== "string") {
15
8
  return false;
16
9
  }
17
10
  return deleteProp(target, key);
18
11
  }
19
- /**
20
- * Delete target hidden property
21
- *
22
- * @param {any} target - target
23
- * @param {symbol} key - hidden key
24
- * @return {boolean} - is deleted?
25
- * */
26
12
  export function deleteSymbol(target, key) {
27
- if (typeof key !== 'symbol') {
13
+ if (typeof key !== "symbol") {
28
14
  return false;
29
15
  }
30
16
  return deleteProp(target, key);
31
17
  }
32
- /**
33
- * Delete target property
34
- *
35
- * @param {any} target - target
36
- * @param {(symbol|string)} key - key
37
- * @return {boolean} - is deleted?
38
- * */
39
18
  export function deleteProp(target, key) {
40
- if (!['symbol', 'string'].includes(typeof key)) {
19
+ if (!["symbol", "string"].includes(typeof key)) {
41
20
  return false;
42
21
  }
43
- if (!target || !['object', 'function'].includes(typeof target)) {
22
+ if (!target || !["object", "function"].includes(typeof target)) {
44
23
  return false;
45
24
  }
46
25
  try {
@@ -48,14 +27,13 @@ export function deleteProp(target, key) {
48
27
  return true;
49
28
  }
50
29
  catch (e) {
51
- // nothing
52
30
  }
53
31
  try {
54
32
  Object.defineProperty(target, key, {
55
33
  value: undefined,
56
34
  configurable: true,
57
35
  writable: false,
58
- enumerable: typeof key === 'string',
36
+ enumerable: typeof key === "string",
59
37
  });
60
38
  delete target[key];
61
39
  return true;
@@ -64,7 +42,7 @@ export function deleteProp(target, key) {
64
42
  if (!_leyyo) {
65
43
  _leyyo = $$get_leyyo_fn();
66
44
  }
67
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
45
+ new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, "ZZZ"), where).log(e);
68
46
  return false;
69
47
  }
70
48
  }
@@ -1,7 +1 @@
1
- /**
2
- * Empty function, it can be more useful sometimes
3
- *
4
- * @param {Arr} _args - insignificant parameters
5
- * @return {any}
6
- * */
7
1
  export declare function emptyFn<R = unknown>(..._args: Array<unknown>): R | void;
@@ -1,9 +1 @@
1
- // noinspection JSUnusedGlobalSymbols
2
- /**
3
- * Empty function, it can be more useful sometimes
4
- *
5
- * @param {Arr} _args - insignificant parameters
6
- * @return {any}
7
- * */
8
- export function emptyFn(..._args) {
9
- }
1
+ export function emptyFn(..._args) { }
@@ -1,8 +1,2 @@
1
1
  import { ExtendedType } from "../base/index.js";
2
- /**
3
- * Get extended type of value
4
- *
5
- * @param {any} value - given value
6
- * @return {ExtendedType}
7
- * */
8
2
  export declare function extendedType(value: unknown): ExtendedType;
@@ -1,54 +1,48 @@
1
1
  import { List } from "../class/list.js";
2
2
  import { KEY_ENUM_NAME, KEY_LITERAL_NAME } from "../const/index.js";
3
3
  import { isClass } from "./is-class.js";
4
- // noinspection JSUnusedGlobalSymbols
5
- /**
6
- * Get extended type of value
7
- *
8
- * @param {any} value - given value
9
- * @return {ExtendedType}
10
- * */
11
4
  export function extendedType(value) {
5
+ let trimmed;
12
6
  switch (typeof value) {
13
7
  case "string":
14
- const trimmed = value.trim();
8
+ trimmed = value.trim();
15
9
  if (!trimmed) {
16
- return 'empty';
10
+ return "empty";
17
11
  }
18
12
  else if (trimmed === value) {
19
- return 'text';
13
+ return "text";
20
14
  }
21
- return 'string';
22
- case 'number':
15
+ return "string";
16
+ case "number":
23
17
  if (isNaN(value)) {
24
- return 'nan';
18
+ return "nan";
25
19
  }
26
- return Number.isInteger(value) ? 'integer' : 'number';
27
- case 'object':
20
+ return Number.isInteger(value) ? "integer" : "number";
21
+ case "object":
28
22
  if (!value) {
29
- return 'null';
23
+ return "null";
30
24
  }
31
25
  if (Array.isArray(value)) {
32
26
  if (value[KEY_LITERAL_NAME]) {
33
- return 'literal-items';
27
+ return "literal-items";
34
28
  }
35
- return (value instanceof List) ? 'list' : 'array';
29
+ return value instanceof List ? "list" : "array";
36
30
  }
37
31
  if (value instanceof Date) {
38
- return 'date';
32
+ return "date";
39
33
  }
40
34
  if (value instanceof Map) {
41
- return 'map';
35
+ return "map";
42
36
  }
43
37
  if (value instanceof Set) {
44
- return 'set';
38
+ return "set";
45
39
  }
46
40
  if (value[KEY_ENUM_NAME]) {
47
- return 'enum-map';
41
+ return "enum-map";
48
42
  }
49
- return 'object';
43
+ return "object";
50
44
  case "function":
51
- return isClass(value) ? 'class' : 'function';
45
+ return isClass(value) ? "class" : "function";
52
46
  default:
53
47
  return typeof value;
54
48
  }
@@ -1,8 +1,2 @@
1
1
  import { FqnTarget } from "./index.types.js";
2
- /**
3
- * Get fqn name
4
- *
5
- * @param {FqnTarget} target - target (function, class, instance, enum, literal)
6
- * @return {string} - fully qualified name
7
- * */
8
2
  export declare function getFqn(target: FqnTarget): string;
@@ -1,18 +1,12 @@
1
1
  import { KEY_ENUM_NAME, KEY_FQN_NAME, KEY_LITERAL_NAME } from "../const/index.js";
2
- /**
3
- * Get fqn name
4
- *
5
- * @param {FqnTarget} target - target (function, class, instance, enum, literal)
6
- * @return {string} - fully qualified name
7
- * */
8
2
  export function getFqn(target) {
9
3
  if (!target) {
10
4
  return undefined;
11
5
  }
12
- if (typeof target === 'function') { // function, class
6
+ if (typeof target === "function") {
13
7
  return target[KEY_FQN_NAME] ?? target.name;
14
8
  }
15
- else if (typeof target === 'object') {
9
+ else if (typeof target === "object") {
16
10
  if (Array.isArray(target)) {
17
11
  if (target[KEY_LITERAL_NAME]) {
18
12
  return target[KEY_FQN_NAME] ?? target[KEY_LITERAL_NAME];
@@ -1,24 +1,3 @@
1
- /**
2
- * Get target property
3
- *
4
- * @param {any} target - target
5
- * @param {string} key - key
6
- * @return {any}
7
- * */
8
1
  export declare function getKey<T>(target: unknown, key: string): T;
9
- /**
10
- * Get target hidden property
11
- *
12
- * @param {any} target - target
13
- * @param {symbol} key - hidden key
14
- * @return {any}
15
- * */
16
2
  export declare function getSymbol<T>(target: unknown, key: symbol): T;
17
- /**
18
- * Get target property
19
- *
20
- * @param {any} target - target
21
- * @param {(symbol|string)} key - key
22
- * @return {any}
23
- * */
24
3
  export declare function getProp<T>(target: unknown, key: symbol | string): T;
@@ -3,44 +3,23 @@ import { testCase } from "./test-case.js";
3
3
  import { $$get_leyyo_fn } from "./leyyo-fn.js";
4
4
  const where = `${FQN}.GetProp`;
5
5
  let _leyyo;
6
- /**
7
- * Get target property
8
- *
9
- * @param {any} target - target
10
- * @param {string} key - key
11
- * @return {any}
12
- * */
13
6
  export function getKey(target, key) {
14
- if (typeof key !== 'string') {
7
+ if (typeof key !== "string") {
15
8
  return undefined;
16
9
  }
17
10
  return getProp(target, key);
18
11
  }
19
- /**
20
- * Get target hidden property
21
- *
22
- * @param {any} target - target
23
- * @param {symbol} key - hidden key
24
- * @return {any}
25
- * */
26
12
  export function getSymbol(target, key) {
27
- if (typeof key !== 'symbol') {
13
+ if (typeof key !== "symbol") {
28
14
  return undefined;
29
15
  }
30
16
  return getProp(target, key);
31
17
  }
32
- /**
33
- * Get target property
34
- *
35
- * @param {any} target - target
36
- * @param {(symbol|string)} key - key
37
- * @return {any}
38
- * */
39
18
  export function getProp(target, key) {
40
- if (!['symbol', 'string'].includes(typeof key)) {
19
+ if (!["symbol", "string"].includes(typeof key)) {
41
20
  return undefined;
42
21
  }
43
- if (!target || !['object', 'function'].includes(typeof target)) {
22
+ if (!target || !["object", "function"].includes(typeof target)) {
44
23
  return undefined;
45
24
  }
46
25
  try {
@@ -51,7 +30,7 @@ export function getProp(target, key) {
51
30
  if (!_leyyo) {
52
31
  _leyyo = $$get_leyyo_fn();
53
32
  }
54
- new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, 'ZZZ'), where).log(e);
33
+ new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, testCase(FQN, "ZZZ"), where).log(e);
55
34
  return undefined;
56
35
  }
57
36
  }
@@ -39,40 +39,20 @@ export interface StatisticsOs {
39
39
  cpu: Array<StatisticsCpuInfo>;
40
40
  }
41
41
  export interface StatisticsMemory {
42
- /**
43
- * Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the
44
- * process, including all C++ and JavaScript objects and code.
45
- */
46
42
  rss: number;
47
- /**
48
- * Refers to V8's memory usage.
49
- */
50
43
  heapTotal: number;
51
- /**
52
- * Refers to V8's memory usage.
53
- */
54
44
  heapUsed: number;
55
45
  external: number;
56
- /**
57
- * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included
58
- * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s
59
- * may not be tracked in that case.
60
- */
61
46
  arrayBuffers: number;
62
47
  }
63
48
  export interface StatisticsCpuInfo {
64
49
  model: string;
65
50
  speed: number;
66
51
  times: {
67
- /** The number of milliseconds the CPU has spent in user mode. */
68
52
  user: number;
69
- /** The number of milliseconds the CPU has spent in nice mode. */
70
53
  nice: number;
71
- /** The number of milliseconds the CPU has spent in sys mode. */
72
54
  sys: number;
73
- /** The number of milliseconds the CPU has spent in idle mode. */
74
55
  idle: number;
75
- /** The number of milliseconds the CPU has spent in irq mode. */
76
56
  irq: number;
77
57
  };
78
58
  }
@@ -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(),
@@ -1,8 +1,2 @@
1
1
  import { FqnTarget } from "./index.types.js";
2
- /**
3
- * Get fqn name
4
- *
5
- * @param {FqnTarget} target - target (function, class, instance, enum, literal)
6
- * @return {string} - fully qualified name
7
- * */
8
2
  export declare function hasFqn(target: FqnTarget): boolean;
@@ -1,18 +1,12 @@
1
1
  import { KEY_ENUM_NAME, KEY_FQN_NAME, KEY_LITERAL_NAME } from "../const/index.js";
2
- /**
3
- * Get fqn name
4
- *
5
- * @param {FqnTarget} target - target (function, class, instance, enum, literal)
6
- * @return {string} - fully qualified name
7
- * */
8
2
  export function hasFqn(target) {
9
3
  if (!target) {
10
4
  return false;
11
5
  }
12
- if (typeof target === 'function') { // function, class
6
+ if (typeof target === "function") {
13
7
  return !!target[KEY_FQN_NAME];
14
8
  }
15
- else if (typeof target === 'object') {
9
+ else if (typeof target === "object") {
16
10
  if (Array.isArray(target)) {
17
11
  if (target[KEY_LITERAL_NAME]) {
18
12
  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;
@@ -1,7 +1 @@
1
- /**
2
- * Is class?
3
- *
4
- * @param {any} fn - given value
5
- * @return {boolean} - is class?
6
- * */
7
1
  export declare function isClass(fn: unknown): boolean;
@@ -1,29 +1,11 @@
1
- /**
2
- * Is class?
3
- *
4
- * @param {any} fn - given value
5
- * @return {boolean} - is class?
6
- * */
7
1
  export function isClass(fn) {
8
- if (typeof fn !== 'function') {
2
+ if (typeof fn !== "function") {
9
3
  return false;
10
4
  }
11
5
  try {
12
- return Function.prototype.toString.call(fn).toString().startsWith('class ');
6
+ return Function.prototype.toString.call(fn).toString().startsWith("class ");
13
7
  }
14
8
  catch (e) {
15
9
  return false;
16
10
  }
17
- // // Class constructor is also a function
18
- // if ( !(fn && fn.constructor === Function) || (fn as Fnc).prototype === undefined) {
19
- // return false;
20
- // }
21
- //
22
- // // This is a class that extends other class
23
- // if (Function.prototype !== Object.getPrototypeOf(fn)) {
24
- // return true;
25
- // }
26
- //
27
- // // Usually a function will only have 'constructor' in the prototype
28
- // return Object.getOwnPropertyNames((fn as Fnc).prototype).length > 1;
29
11
  }
@@ -1,12 +1 @@
1
- /**
2
- * Is empty?
3
- * Means:
4
- * - `not null`
5
- * - `not undefined`
6
- * - `not empty string`
7
- *
8
- * @param {any} value - given value
9
- * @param {boolean?} notSpace - yes: ignore empty string
10
- * @return {boolean} - is empty?
11
- * */
12
1
  export declare function isEmpty(value: unknown, notSpace?: boolean): boolean;
@@ -1,18 +1,7 @@
1
1
  import { EMPTY_VALUES } from "../const/index.js";
2
- /**
3
- * Is empty?
4
- * Means:
5
- * - `not null`
6
- * - `not undefined`
7
- * - `not empty string`
8
- *
9
- * @param {any} value - given value
10
- * @param {boolean?} notSpace - yes: ignore empty string
11
- * @return {boolean} - is empty?
12
- * */
13
2
  export function isEmpty(value, notSpace) {
14
3
  if (notSpace) {
15
4
  return EMPTY_VALUES.includes(value);
16
5
  }
17
- return EMPTY_VALUES.includes(value) || (typeof value === 'string' && !value.trim());
6
+ return EMPTY_VALUES.includes(value) || (typeof value === "string" && !value.trim());
18
7
  }