@leyyo/common 1.3.17 → 1.3.18

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.
@@ -1,7 +1,7 @@
1
1
  import { DeployCommon, EnumPool, ErrorCommon, ErrorPool, EventCommon, LifecycleCommon, LiteralPool, LogCommon, RepoCommon } from "../common/index.js";
2
2
  import { DeveloperError, LeyyoError } from "../error/index.js";
3
3
  import { LoggerInstance } from "../class/logger.instance.js";
4
- import { KEY_SECURE_1 } from "../const/index.js";
4
+ import { KEY_LEYYO_SECURE } from "../const/index.js";
5
5
  import { $$set_leyyo_fn } from "../function/leyyo-fn.js";
6
6
  class Leyyo {
7
7
  _developerError;
@@ -21,11 +21,11 @@ class Leyyo {
21
21
  // region binding
22
22
  $$set_leyyo_fn(this);
23
23
  this._developerError = DeveloperError;
24
- this._developerError[KEY_SECURE_1](this);
24
+ this._developerError[KEY_LEYYO_SECURE](this);
25
25
  this._leyyoError = LeyyoError;
26
- this._leyyoError[KEY_SECURE_1](this);
26
+ this._leyyoError[KEY_LEYYO_SECURE](this);
27
27
  this._loggerInstance = LoggerInstance;
28
- this._loggerInstance[KEY_SECURE_1](this);
28
+ this._loggerInstance[KEY_LEYYO_SECURE](this);
29
29
  // endregion binding
30
30
  // region instances
31
31
  this._repoCommon = new RepoCommon(this); // none
@@ -1,12 +1,12 @@
1
1
  import { LeyyoLike } from "../base/index.js";
2
2
  import { LogLevel } from "../enum/index.js";
3
3
  import { Opt } from "../function/index.js";
4
- import { KEY_SECURE_1 } from "../const/index.js";
4
+ import { KEY_LEYYO_SECURE } from "../const/index.js";
5
5
  import { Logger, LoggerSecure } from "../common/index.js";
6
6
  export declare class LoggerInstance implements Logger, LoggerSecure {
7
7
  private _name;
8
8
  constructor(name: string);
9
- static [KEY_SECURE_1](leyyo: LeyyoLike): void;
9
+ static [KEY_LEYYO_SECURE](leyyo: LeyyoLike): void;
10
10
  debug(message: any, params?: any | Opt): void;
11
11
  trace(message: any, params?: any | Opt): void;
12
12
  info(message: any, params?: any | Opt): void;
@@ -1,5 +1,5 @@
1
1
  import { isText } from "../function/index.js";
2
- import { KEY_SECURE_1 } from "../const/index.js";
2
+ import { KEY_LEYYO_SECURE } from "../const/index.js";
3
3
  // region property
4
4
  let _leyyo;
5
5
  // endregion property
@@ -13,7 +13,7 @@ export class LoggerInstance {
13
13
  this._name = name;
14
14
  }
15
15
  // region static
16
- static [KEY_SECURE_1](leyyo) {
16
+ static [KEY_LEYYO_SECURE](leyyo) {
17
17
  if (!_leyyo) {
18
18
  _leyyo = leyyo;
19
19
  }
@@ -1,5 +1,3 @@
1
- export declare const KEY_FQN_NAME: unique symbol;
2
- export declare const KEY_FQN_ON_SET: unique symbol;
3
1
  export declare const VAL_FQN_ANONYMOUS = "#Fqn";
4
2
  /**
5
3
  * Normal empty values
@@ -8,12 +6,14 @@ export declare const EMPTY_VALUES: any[];
8
6
  /**
9
7
  * Empty values with empty string
10
8
  * */
11
- export declare const EMPTY_VALUES_STR: string[];
12
- export declare const VAL_NAME_ANONYMOUS = "~";
13
- export declare const KEY_SECURE_1: unique symbol;
14
- export declare const KEY_ERROR_HTTP_STATUS: unique symbol;
9
+ export declare const EMPTY_VALUES_STR: Array<unknown>;
10
+ export declare const VAL_NAME_ANONYMOUS: string;
15
11
  export declare const VAL_ERROR_UNKNOWN_NAME: string;
16
12
  export declare const VAL_ERROR_UNKNOWN_MESSAGE: string;
13
+ export declare const KEY_FQN_NAME: unique symbol;
14
+ export declare const KEY_FQN_ON_SET: unique symbol;
15
+ export declare const KEY_LEYYO_SECURE: unique symbol;
16
+ export declare const KEY_ERROR_HTTP_STATUS: unique symbol;
17
17
  export declare const KEY_ERROR_DEFAULT_MESSAGE: unique symbol;
18
18
  export declare const KEY_ERROR_I18N: unique symbol;
19
19
  export declare const KEY_ERROR_EMIT: unique symbol;
@@ -31,3 +31,6 @@ export declare const KEY_ENUM_I18N: unique symbol;
31
31
  export declare const KEY_LITERAL_NAME: unique symbol;
32
32
  export declare const KEY_LITERAL_ALT: unique symbol;
33
33
  export declare const KEY_LITERAL_I18N: unique symbol;
34
+ export declare const KEY_DEVELOPER_MESSAGE: unique symbol;
35
+ export declare const KEY_DEVELOPER_CASE: unique symbol;
36
+ export declare const KEY_DEVELOPER_WHERE: unique symbol;
@@ -1,5 +1,3 @@
1
- export const KEY_FQN_NAME = Symbol.for('leyyo:fqn:basic');
2
- export const KEY_FQN_ON_SET = Symbol.for('leyyo:fqn:on-set');
3
1
  export const VAL_FQN_ANONYMOUS = '#Fqn';
4
2
  /**
5
3
  * Normal empty values
@@ -11,10 +9,12 @@ export const EMPTY_VALUES = [null, undefined];
11
9
  * */
12
10
  export const EMPTY_VALUES_STR = [null, undefined, ''];
13
11
  export const VAL_NAME_ANONYMOUS = '~';
14
- export const KEY_SECURE_1 = Symbol.for('leyyo:secure:1');
15
- export const KEY_ERROR_HTTP_STATUS = Symbol.for('leyyo:http:status');
16
12
  export const VAL_ERROR_UNKNOWN_NAME = 'UnknownError';
17
13
  export const VAL_ERROR_UNKNOWN_MESSAGE = 'Unknown error';
14
+ export const KEY_FQN_NAME = Symbol.for('leyyo:fqn:basic');
15
+ export const KEY_FQN_ON_SET = Symbol.for('leyyo:fqn:on-set');
16
+ export const KEY_LEYYO_SECURE = Symbol.for('leyyo:secure');
17
+ export const KEY_ERROR_HTTP_STATUS = Symbol.for('leyyo:error:http-status');
18
18
  export const KEY_ERROR_DEFAULT_MESSAGE = Symbol.for('leyyo:error:message');
19
19
  export const KEY_ERROR_I18N = Symbol.for('leyyo:error:i18n');
20
20
  export const KEY_ERROR_EMIT = Symbol.for('leyyo:error:emit');
@@ -26,9 +26,12 @@ export const KEY_LOADER_NAME = Symbol.for('leyyo:loader:name');
26
26
  export const KEY_LOADER_STAMP = Symbol.for('leyyo:loader:stamp');
27
27
  export const KEY_LOADER_EMPTY = Symbol.for('leyyo:loader:empty');
28
28
  export const KEY_LOG_ALREADY = Symbol.for('leyyo:log:already');
29
- export const KEY_ENUM_NAME = Symbol.for('leyyo::enum:name');
29
+ export const KEY_ENUM_NAME = Symbol.for('leyyo:enum:name');
30
30
  export const KEY_ENUM_ALT = Symbol.for('leyyo:enum:alt');
31
31
  export const KEY_ENUM_I18N = Symbol.for('leyyo:enum:i18n');
32
- export const KEY_LITERAL_NAME = Symbol.for('leyyo::literal:name');
32
+ export const KEY_LITERAL_NAME = Symbol.for('leyyo:literal:name');
33
33
  export const KEY_LITERAL_ALT = Symbol.for('leyyo:literal:alt');
34
34
  export const KEY_LITERAL_I18N = Symbol.for('leyyo:literal:i18n');
35
+ export const KEY_DEVELOPER_MESSAGE = Symbol.for('leyyo:developer:message');
36
+ export const KEY_DEVELOPER_CASE = Symbol.for('leyyo:developer:case');
37
+ export const KEY_DEVELOPER_WHERE = Symbol.for('leyyo:developer:where');
@@ -1,14 +1,11 @@
1
- import { KEY_SECURE_1 } from "../const/index.js";
1
+ import { KEY_DEVELOPER_CASE, KEY_DEVELOPER_MESSAGE, KEY_DEVELOPER_WHERE, KEY_LEYYO_SECURE } from "../const/index.js";
2
2
  import { LeyyoLike } from "../base/index.js";
3
3
  import { DeveloperErrorLike, ErrorStackLine } from "./index.types.js";
4
- declare const LY_DEVELOPER_MESSAGE: unique symbol;
5
- declare const LY_DEVELOPER_CASE: unique symbol;
6
- declare const LY_DEVELOPER_WHERE: unique symbol;
7
4
  /** Developer error */
8
5
  export declare class DeveloperError extends Error implements DeveloperErrorLike {
9
- protected [LY_DEVELOPER_MESSAGE]: string;
10
- protected [LY_DEVELOPER_CASE]: string;
11
- protected [LY_DEVELOPER_WHERE]: string;
6
+ protected [KEY_DEVELOPER_MESSAGE]: string;
7
+ protected [KEY_DEVELOPER_CASE]: string;
8
+ protected [KEY_DEVELOPER_WHERE]: string;
12
9
  /** @inheritDoc */
13
10
  stackTrace?: Array<ErrorStackLine>;
14
11
  /**
@@ -17,8 +14,7 @@ export declare class DeveloperError extends Error implements DeveloperErrorLike
17
14
  * @param {string} where - where
18
15
  * */
19
16
  constructor(message: string, issue?: string, where?: string);
20
- static [KEY_SECURE_1](leyyo: LeyyoLike): void;
17
+ static [KEY_LEYYO_SECURE](leyyo: LeyyoLike): void;
21
18
  /** @inheritDoc */
22
19
  log(err?: Error): void;
23
20
  }
24
- export {};
@@ -1,15 +1,12 @@
1
- import { KEY_SECURE_1 } from "../const/index.js";
1
+ import { KEY_DEVELOPER_CASE, KEY_DEVELOPER_MESSAGE, KEY_DEVELOPER_WHERE, KEY_LEYYO_SECURE } from "../const/index.js";
2
2
  // region properties
3
- const LY_DEVELOPER_MESSAGE = Symbol.for('leyyo/developer.message');
4
- const LY_DEVELOPER_CASE = Symbol.for('leyyo/developer.case');
5
- const LY_DEVELOPER_WHERE = Symbol.for('leyyo/developer.where');
6
3
  let _leyyo;
7
4
  // endregion properties
8
5
  /** Developer error */
9
6
  export class DeveloperError extends Error {
10
- [LY_DEVELOPER_MESSAGE];
11
- [LY_DEVELOPER_CASE];
12
- [LY_DEVELOPER_WHERE];
7
+ [KEY_DEVELOPER_MESSAGE];
8
+ [KEY_DEVELOPER_CASE];
9
+ [KEY_DEVELOPER_WHERE];
13
10
  /** @inheritDoc */
14
11
  stackTrace;
15
12
  /**
@@ -27,16 +24,16 @@ export class DeveloperError extends Error {
27
24
  message += ` [w:${where}]`;
28
25
  }
29
26
  super(message);
30
- this[LY_DEVELOPER_MESSAGE] = pureMessage;
27
+ this[KEY_DEVELOPER_MESSAGE] = pureMessage;
31
28
  if (typeof issue === 'string') {
32
- this[LY_DEVELOPER_CASE] = issue;
29
+ this[KEY_DEVELOPER_CASE] = issue;
33
30
  }
34
31
  if (typeof where === 'string') {
35
- this[LY_DEVELOPER_WHERE] = where;
32
+ this[KEY_DEVELOPER_WHERE] = where;
36
33
  }
37
34
  _leyyo.errorCommon.buildStack(this);
38
35
  }
39
- static [KEY_SECURE_1](leyyo) {
36
+ static [KEY_LEYYO_SECURE](leyyo) {
40
37
  if (!_leyyo) {
41
38
  _leyyo = leyyo;
42
39
  }
@@ -46,6 +43,6 @@ export class DeveloperError extends Error {
46
43
  if (err instanceof Error) {
47
44
  this['causedBy'] = err;
48
45
  }
49
- _leyyo.logCommon.emitLog('fatal', this[LY_DEVELOPER_WHERE], this, _leyyo.errorCommon.toJsonBasic(this, { testCase: this[LY_DEVELOPER_CASE] }));
46
+ _leyyo.logCommon.emitLog('fatal', this[KEY_DEVELOPER_WHERE], this, _leyyo.errorCommon.toJsonBasic(this, { testCase: this[KEY_DEVELOPER_CASE] }));
50
47
  }
51
48
  }
@@ -2,7 +2,7 @@ import { Logger } from "../common/index.js";
2
2
  import { ErrorStackLine, LeyyoErrorLike, LeyyoErrorSecure, LeyyoErrorTag } from "./index.types.js";
3
3
  import { ClassLike, LeyyoLike, Obj, OneOrMore } from "../base/index.js";
4
4
  import { Opt } from "../function/index.js";
5
- import { KEY_ERROR_FLAGS, KEY_SECURE_1 } from "../const/index.js";
5
+ import { KEY_ERROR_FLAGS, KEY_LEYYO_SECURE } from "../const/index.js";
6
6
  type T2 = LeyyoErrorTag;
7
7
  /**
8
8
  * Leyyo base error
@@ -40,7 +40,7 @@ export declare class LeyyoError extends Error implements LeyyoErrorLike, LeyyoEr
40
40
  * @param {Opt} params - error parameters
41
41
  * */
42
42
  constructor(message: string, params: Opt);
43
- static [KEY_SECURE_1](leyyo: LeyyoLike): void;
43
+ static [KEY_LEYYO_SECURE](leyyo: LeyyoLike): void;
44
44
  causes(err: Error): this;
45
45
  where(p1: ClassLike | Obj | string, fqn?: string): this;
46
46
  private _log;
@@ -1,5 +1,5 @@
1
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";
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
5
  const _errorField = ['name', 'message', 'stack'];
@@ -54,7 +54,7 @@ export class LeyyoError extends Error {
54
54
  _leyyo.errorCommon.buildStack(this);
55
55
  _leyyo.errorCommon.emit(this);
56
56
  }
57
- static [KEY_SECURE_1](leyyo) {
57
+ static [KEY_LEYYO_SECURE](leyyo) {
58
58
  if (!_leyyo) {
59
59
  _leyyo = leyyo;
60
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leyyo/common",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Leyyo common library",
5
5
  "keywords": [
6
6
  "common"