@leyyo/common 1.2.6 → 1.3.1
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.
- package/README.md +395 -3
- package/dist/class/index.d.ts +2 -0
- package/dist/{opt → class}/index.js +2 -1
- package/dist/class/index.js.map +1 -0
- package/dist/class/list.d.ts +13 -0
- package/dist/class/list.js +37 -0
- package/dist/class/list.js.map +1 -0
- package/dist/{log → class}/logger.instance.d.ts +10 -12
- package/dist/class/logger.instance.js +150 -0
- package/dist/class/logger.instance.js.map +1 -0
- package/dist/common/array.fn.d.ts +46 -0
- package/dist/common/array.fn.js +123 -0
- package/dist/common/array.fn.js.map +1 -0
- package/dist/common/deploy.fn.d.ts +18 -0
- package/dist/common/deploy.fn.js +73 -0
- package/dist/common/deploy.fn.js.map +1 -0
- package/dist/common/enum.fn.d.ts +63 -0
- package/dist/common/enum.fn.js +191 -0
- package/dist/common/enum.fn.js.map +1 -0
- package/dist/common/error.fn.d.ts +91 -0
- package/dist/common/error.fn.js +400 -0
- package/dist/common/error.fn.js.map +1 -0
- package/dist/common/event.fn.d.ts +45 -0
- package/dist/common/event.fn.js +160 -0
- package/dist/common/event.fn.js.map +1 -0
- package/dist/common/exporter.fn.d.ts +7 -0
- package/dist/common/exporter.fn.js +49 -0
- package/dist/common/exporter.fn.js.map +1 -0
- package/dist/common/fqn.fn.d.ts +27 -0
- package/dist/common/fqn.fn.js +104 -0
- package/dist/common/fqn.fn.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/{hub → common}/index.js +14 -1
- package/dist/common/index.js.map +1 -0
- package/dist/common/lifecycle.fn.d.ts +24 -0
- package/dist/common/lifecycle.fn.js +135 -0
- package/dist/common/lifecycle.fn.js.map +1 -0
- package/dist/common/list.fn.d.ts +47 -0
- package/dist/common/list.fn.js +122 -0
- package/dist/common/list.fn.js.map +1 -0
- package/dist/common/loader.fn.d.ts +15 -0
- package/dist/common/loader.fn.js +38 -0
- package/dist/common/loader.fn.js.map +1 -0
- package/dist/common/log.fn.d.ts +21 -0
- package/dist/common/log.fn.js +321 -0
- package/dist/common/log.fn.js.map +1 -0
- package/dist/common/map.fn.d.ts +46 -0
- package/dist/common/map.fn.js +123 -0
- package/dist/common/map.fn.js.map +1 -0
- package/dist/common/opt.fn.d.ts +48 -0
- package/dist/common/opt.fn.js +137 -0
- package/dist/common/opt.fn.js.map +1 -0
- package/dist/common/set.fn.d.ts +46 -0
- package/dist/common/set.fn.js +123 -0
- package/dist/common/set.fn.js.map +1 -0
- package/dist/common/test.fn.d.ts +26 -0
- package/dist/common/test.fn.js +81 -0
- package/dist/common/test.fn.js.map +1 -0
- package/dist/const/index.d.ts +23 -0
- package/dist/const/index.js +28 -0
- package/dist/const/index.js.map +1 -0
- package/dist/enum/index.d.ts +1 -0
- package/dist/{deploy → enum}/index.js +1 -1
- package/dist/enum/index.js.map +1 -0
- package/dist/{log → enum}/log-level.js +2 -2
- package/dist/enum/log-level.js.map +1 -0
- package/dist/error/caused.error.d.ts +15 -0
- package/dist/error/caused.error.js +24 -0
- package/dist/error/caused.error.js.map +1 -0
- package/dist/error/developer.error.d.ts +24 -0
- package/dist/error/developer.error.js +69 -0
- package/dist/error/developer.error.js.map +1 -0
- package/dist/error/{items/http.error.d.ts → http.error.d.ts} +1 -1
- package/dist/error/http.error.js +31 -0
- package/dist/error/http.error.js.map +1 -0
- package/dist/error/index.d.ts +6 -3
- package/dist/error/index.js +6 -3
- package/dist/error/index.js.map +1 -1
- package/dist/error/{items/invalid-value.error.js → invalid-value.error.js} +6 -2
- package/dist/error/invalid-value.error.js.map +1 -0
- package/dist/error/leyyo.error.d.ts +87 -0
- package/dist/error/leyyo.error.js +259 -0
- package/dist/error/leyyo.error.js.map +1 -0
- package/dist/error/{items/multiple.error.d.ts → multiple.error.d.ts} +1 -1
- package/dist/error/{items/multiple.error.js → multiple.error.js} +5 -4
- package/dist/error/multiple.error.js.map +1 -0
- package/dist/{util → function}/delay.js +1 -0
- package/dist/function/delay.js.map +1 -0
- package/dist/function/empty.fn.d.ts +8 -0
- package/dist/{util → function}/empty.fn.js +3 -2
- package/dist/function/empty.fn.js.map +1 -0
- package/dist/function/error-obj.d.ts +8 -0
- package/dist/function/error-obj.js +25 -0
- package/dist/function/error-obj.js.map +1 -0
- package/dist/function/error-text.d.ts +7 -0
- package/dist/function/error-text.js +18 -0
- package/dist/function/error-text.js.map +1 -0
- package/dist/function/extended-type.d.ts +8 -0
- package/dist/function/extended-type.js +56 -0
- package/dist/function/extended-type.js.map +1 -0
- package/dist/{util → function}/index.d.ts +4 -4
- package/dist/{util → function}/index.js +4 -4
- package/dist/function/index.js.map +1 -0
- package/dist/{util → function}/is.d.ts +12 -13
- package/dist/function/is.js +89 -0
- package/dist/function/is.js.map +1 -0
- package/dist/{util → function}/jitter-interval.js +1 -0
- package/dist/function/jitter-interval.js.map +1 -0
- package/dist/{util → function}/one-or-more.d.ts +1 -1
- package/dist/{util → function}/one-or-more.js +1 -0
- package/dist/function/one-or-more.js.map +1 -0
- package/dist/{util → function}/secure-clone.d.ts +1 -1
- package/dist/function/secure-clone.js.map +1 -0
- package/dist/function/secure-json.js.map +1 -0
- package/dist/index.d.ts +7 -19
- package/dist/index.js +7 -21
- package/dist/index.js.map +1 -1
- package/dist/index.types.d.ts +510 -0
- package/dist/{shared/index.types.js → index.types.js} +1 -1
- package/dist/index.types.js.map +1 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +98 -0
- package/dist/loader.js.map +1 -0
- package/package.json +5 -3
- package/dist/$$leyyo-loader.d.ts +0 -1
- package/dist/$$leyyo-loader.js +0 -40
- package/dist/$$leyyo-loader.js.map +0 -1
- package/dist/deploy/deploy.common.d.ts +0 -34
- package/dist/deploy/deploy.common.js +0 -125
- package/dist/deploy/deploy.common.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -1
- package/dist/deploy/index.js.map +0 -1
- package/dist/deploy/index.types.d.ts +0 -29
- package/dist/deploy/index.types.js +0 -3
- package/dist/deploy/index.types.js.map +0 -1
- package/dist/error/error.common.d.ts +0 -34
- package/dist/error/error.common.js +0 -220
- package/dist/error/error.common.js.map +0 -1
- package/dist/error/index.const.d.ts +0 -4
- package/dist/error/index.const.js +0 -8
- package/dist/error/index.const.js.map +0 -1
- package/dist/error/index.types.d.ts +0 -109
- package/dist/error/index.types.js +0 -3
- package/dist/error/index.types.js.map +0 -1
- package/dist/error/items/caused.error.d.ts +0 -6
- package/dist/error/items/caused.error.js +0 -11
- package/dist/error/items/caused.error.js.map +0 -1
- package/dist/error/items/developer.error.d.ts +0 -4
- package/dist/error/items/developer.error.js +0 -11
- package/dist/error/items/developer.error.js.map +0 -1
- package/dist/error/items/http.error.js +0 -37
- package/dist/error/items/http.error.js.map +0 -1
- package/dist/error/items/index.d.ts +0 -6
- package/dist/error/items/index.js +0 -23
- package/dist/error/items/index.js.map +0 -1
- package/dist/error/items/invalid-value.error.js.map +0 -1
- package/dist/error/items/leyyo.error.d.ts +0 -60
- package/dist/error/items/leyyo.error.js +0 -144
- package/dist/error/items/leyyo.error.js.map +0 -1
- package/dist/error/items/multiple.error.js.map +0 -1
- package/dist/event/event.common.d.ts +0 -80
- package/dist/event/event.common.js +0 -308
- package/dist/event/event.common.js.map +0 -1
- package/dist/event/event.error.d.ts +0 -3
- package/dist/event/event.error.js +0 -9
- package/dist/event/event.error.js.map +0 -1
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.js +0 -19
- package/dist/event/index.js.map +0 -1
- package/dist/event/index.types.d.ts +0 -265
- package/dist/event/index.types.js +0 -3
- package/dist/event/index.types.js.map +0 -1
- package/dist/hub/hub.channel.d.ts +0 -27
- package/dist/hub/hub.channel.js +0 -83
- package/dist/hub/hub.channel.js.map +0 -1
- package/dist/hub/hub.common.d.ts +0 -27
- package/dist/hub/hub.common.js +0 -92
- package/dist/hub/hub.common.js.map +0 -1
- package/dist/hub/index.d.ts +0 -1
- package/dist/hub/index.js.map +0 -1
- package/dist/hub/index.types.d.ts +0 -105
- package/dist/hub/index.types.js +0 -3
- package/dist/hub/index.types.js.map +0 -1
- package/dist/leyyo/index.d.ts +0 -1
- package/dist/leyyo/index.js +0 -18
- package/dist/leyyo/index.js.map +0 -1
- package/dist/leyyo/index.types.d.ts +0 -21
- package/dist/leyyo/index.types.js +0 -3
- package/dist/leyyo/index.types.js.map +0 -1
- package/dist/leyyo/leyyo.d.ts +0 -25
- package/dist/leyyo/leyyo.js +0 -62
- package/dist/leyyo/leyyo.js.map +0 -1
- package/dist/log/index.d.ts +0 -4
- package/dist/log/index.js +0 -21
- package/dist/log/index.js.map +0 -1
- package/dist/log/index.types.d.ts +0 -47
- package/dist/log/index.types.js +0 -3
- package/dist/log/index.types.js.map +0 -1
- package/dist/log/log-level.js.map +0 -1
- package/dist/log/log.common.d.ts +0 -15
- package/dist/log/log.common.js +0 -135
- package/dist/log/log.common.js.map +0 -1
- package/dist/log/logger.error.d.ts +0 -3
- package/dist/log/logger.error.js +0 -9
- package/dist/log/logger.error.js.map +0 -1
- package/dist/log/logger.instance.js +0 -139
- package/dist/log/logger.instance.js.map +0 -1
- package/dist/name/index.d.ts +0 -2
- package/dist/name/index.js +0 -19
- package/dist/name/index.js.map +0 -1
- package/dist/name/index.types.d.ts +0 -21
- package/dist/name/index.types.js +0 -3
- package/dist/name/index.types.js.map +0 -1
- package/dist/name/name.common.d.ts +0 -16
- package/dist/name/name.common.js +0 -109
- package/dist/name/name.common.js.map +0 -1
- package/dist/name/name.error.d.ts +0 -3
- package/dist/name/name.error.js +0 -9
- package/dist/name/name.error.js.map +0 -1
- package/dist/opt/index.d.ts +0 -1
- package/dist/opt/index.js.map +0 -1
- package/dist/opt/index.types.d.ts +0 -33
- package/dist/opt/index.types.js +0 -3
- package/dist/opt/index.types.js.map +0 -1
- package/dist/opt/opt.common.d.ts +0 -15
- package/dist/opt/opt.common.js +0 -93
- package/dist/opt/opt.common.js.map +0 -1
- package/dist/repo/index.d.ts +0 -1
- package/dist/repo/index.js +0 -18
- package/dist/repo/index.js.map +0 -1
- package/dist/repo/index.types.d.ts +0 -104
- package/dist/repo/index.types.js +0 -3
- package/dist/repo/index.types.js.map +0 -1
- package/dist/repo/repo.common.d.ts +0 -41
- package/dist/repo/repo.common.js +0 -146
- package/dist/repo/repo.common.js.map +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -5
- package/dist/server.js.map +0 -1
- package/dist/shared/index.d.ts +0 -5
- package/dist/shared/index.enum.d.ts +0 -7
- package/dist/shared/index.enum.js +0 -3
- package/dist/shared/index.enum.js.map +0 -1
- package/dist/shared/index.fqn.d.ts +0 -3
- package/dist/shared/index.fqn.js +0 -3
- package/dist/shared/index.fqn.js.map +0 -1
- package/dist/shared/index.js +0 -22
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/index.json.d.ts +0 -33
- package/dist/shared/index.json.js +0 -3
- package/dist/shared/index.json.js.map +0 -1
- package/dist/shared/index.loader.d.ts +0 -5
- package/dist/shared/index.loader.js +0 -3
- package/dist/shared/index.loader.js.map +0 -1
- package/dist/shared/index.types.d.ts +0 -168
- package/dist/shared/index.types.js.map +0 -1
- package/dist/util/$define-error.d.ts +0 -9
- package/dist/util/$define-error.js +0 -25
- package/dist/util/$define-error.js.map +0 -1
- package/dist/util/$enum-name.d.ts +0 -16
- package/dist/util/$enum-name.js +0 -18
- package/dist/util/$enum-name.js.map +0 -1
- package/dist/util/$loader.d.ts +0 -18
- package/dist/util/$loader.js +0 -40
- package/dist/util/$loader.js.map +0 -1
- package/dist/util/delay.js.map +0 -1
- package/dist/util/empty.fn.d.ts +0 -8
- package/dist/util/empty.fn.js.map +0 -1
- package/dist/util/index.js.map +0 -1
- package/dist/util/is.js +0 -68
- package/dist/util/is.js.map +0 -1
- package/dist/util/jitter-interval.js.map +0 -1
- package/dist/util/one-or-more.js.map +0 -1
- package/dist/util/secure-clone.js.map +0 -1
- package/dist/util/secure-json.js.map +0 -1
- /package/dist/{log → enum}/log-level.d.ts +0 -0
- /package/dist/error/{items/invalid-value.error.d.ts → invalid-value.error.d.ts} +0 -0
- /package/dist/{util → function}/delay.d.ts +0 -0
- /package/dist/{util → function}/jitter-interval.d.ts +0 -0
- /package/dist/{util → function}/secure-clone.js +0 -0
- /package/dist/{util → function}/secure-json.d.ts +0 -0
- /package/dist/{util → function}/secure-json.js +0 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import type { LogLevel } from "./enum";
|
|
2
|
+
export type HttpStatus = number;
|
|
3
|
+
export type BasicType = 'undefined' | 'string' | 'object' | 'number' | 'boolean' | 'function' | 'symbol' | 'bigint';
|
|
4
|
+
export type ExtendedType = BasicType | 'array' | 'null' | 'enum' | 'class' | 'empty' | 'text' | 'nan' | 'integer' | 'date' | 'map' | 'set' | 'list';
|
|
5
|
+
export type KeyValue = string | number;
|
|
6
|
+
export type AnyKey = string | number | symbol;
|
|
7
|
+
export type Obj = Object & {};
|
|
8
|
+
export type Dict<T = unknown> = Record<KeyValue, T>;
|
|
9
|
+
export type Arr<T = unknown> = Array<T>;
|
|
10
|
+
export type Id = string | number;
|
|
11
|
+
export type Integer = number;
|
|
12
|
+
export type Float = number;
|
|
13
|
+
export type Alpha = string;
|
|
14
|
+
export type Text = string;
|
|
15
|
+
export type Digit = string;
|
|
16
|
+
export type Title = string;
|
|
17
|
+
export type Description = string;
|
|
18
|
+
export type RichText = string;
|
|
19
|
+
export type Uuid = string;
|
|
20
|
+
export type Host = string;
|
|
21
|
+
export type Url = string;
|
|
22
|
+
export type Email = string;
|
|
23
|
+
export type Folder = string;
|
|
24
|
+
export type Timestamp = number;
|
|
25
|
+
export type IsoDatetime = string;
|
|
26
|
+
export type IsoDate = string;
|
|
27
|
+
export type IsoTime = string;
|
|
28
|
+
export type Fnc<R = unknown> = ((...args: Arr) => R) & Function;
|
|
29
|
+
export type Async<R = unknown> = ((...args: Arr) => Promise<R>) & AsyncGeneratorFunction;
|
|
30
|
+
export interface Abstract<T = {}> extends Function {
|
|
31
|
+
prototype: T;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly length: number;
|
|
34
|
+
bind(thisArg: unknown, ...args: Arr): unknown;
|
|
35
|
+
apply(thisArg: unknown, args: Arr): unknown;
|
|
36
|
+
call(thisArg: unknown, ...args: Arr): unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface ClassLike<T = {}> extends Abstract<T> {
|
|
39
|
+
new (...args: Arr): T;
|
|
40
|
+
}
|
|
41
|
+
export type TypeOf<C = ClassLike> = C extends ClassLike<infer T> ? T : C;
|
|
42
|
+
export declare namespace Express {
|
|
43
|
+
interface Request {
|
|
44
|
+
custom?: Dict;
|
|
45
|
+
}
|
|
46
|
+
interface Response {
|
|
47
|
+
custom?: Dict;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export interface Describable {
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
export interface Nameable {
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
export interface HasId {
|
|
57
|
+
id?: string | number;
|
|
58
|
+
}
|
|
59
|
+
export type TypeOfMethod<T, M extends keyof T> = T[M] extends Function ? T[M] : never;
|
|
60
|
+
export type TypeOfFnc<F extends Fnc> = F extends (...args: Arr) => infer R ? R : never;
|
|
61
|
+
export type TypeOfAsync<F extends Async> = TypeOfPromise<TypeOfFnc<F>>;
|
|
62
|
+
export type TypeOfPromise<P> = P extends Promise<infer R> ? R : P;
|
|
63
|
+
/**
|
|
64
|
+
* String keys of an interface
|
|
65
|
+
* - Note: keyof keywords returns string|number|symbol, but it's ignore number and symbol keys
|
|
66
|
+
* */
|
|
67
|
+
export type StrKey<T> = Extract<keyof T, string>;
|
|
68
|
+
/**
|
|
69
|
+
* Serialized version of another type
|
|
70
|
+
*/
|
|
71
|
+
export type Serialized<T> = {
|
|
72
|
+
[P in keyof T]: T[P];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Makes mutable an interface
|
|
76
|
+
*
|
|
77
|
+
* @see Readonly
|
|
78
|
+
* */
|
|
79
|
+
export type Mutable<A> = {
|
|
80
|
+
-readonly [K in keyof A]: A[K];
|
|
81
|
+
};
|
|
82
|
+
export type KeyOf<T> = keyof T;
|
|
83
|
+
export type Keys<T> = Array<keyof T>;
|
|
84
|
+
export type ValueOf<T> = T[KeyOf<T>];
|
|
85
|
+
export type Values<T> = Array<T[KeyOf<T>]>;
|
|
86
|
+
export type OneOrMore<T> = T | Array<T>;
|
|
87
|
+
export type SetOrMore<T> = T | Set<T>;
|
|
88
|
+
/**
|
|
89
|
+
* An interface which contains secure mode members and provides to shift to main mode
|
|
90
|
+
* */
|
|
91
|
+
export interface ShiftSecure<S extends ShiftMain<any>> {
|
|
92
|
+
/**
|
|
93
|
+
* Shifts to secure mode
|
|
94
|
+
* */
|
|
95
|
+
get $secure(): S;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* An interface which contains main mode members and provides to shift to secure mode
|
|
99
|
+
*
|
|
100
|
+
* IT's so useful to hide some public members
|
|
101
|
+
* - to see clean auto-completed members in IDE
|
|
102
|
+
* - to indicated that secure mode members should be used in special cases
|
|
103
|
+
* */
|
|
104
|
+
export interface ShiftMain<M extends ShiftSecure<any>> {
|
|
105
|
+
/**
|
|
106
|
+
* Shifts to main mode
|
|
107
|
+
* */
|
|
108
|
+
get $back(): M;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* An interface which provides to flat generic interfaces/classes to prevent verbose casting commands
|
|
112
|
+
* */
|
|
113
|
+
export interface ShiftFlat<D> {
|
|
114
|
+
/**
|
|
115
|
+
* Flats current classes, or eliminate generic parameters
|
|
116
|
+
* */
|
|
117
|
+
get $flat(): D;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Useful interface which provides initialization state for instances
|
|
121
|
+
* */
|
|
122
|
+
export interface InitLike {
|
|
123
|
+
/**
|
|
124
|
+
* Initializes the instance
|
|
125
|
+
* */
|
|
126
|
+
$init(...args: Arr): void;
|
|
127
|
+
}
|
|
128
|
+
export type EnumMap<E extends KeyValue = KeyValue> = {
|
|
129
|
+
[K in E]: KeyValue;
|
|
130
|
+
};
|
|
131
|
+
export type EnumAlt<E extends KeyValue = KeyValue> = Dict<E>;
|
|
132
|
+
export type EnumLiteral<E extends KeyValue = KeyValue> = Array<E> | ReadonlyArray<E>;
|
|
133
|
+
export type EnumData<E extends KeyValue = KeyValue> = EnumMap<E> | EnumLiteral<E>;
|
|
134
|
+
export type EnumType = 'map' | 'literal';
|
|
135
|
+
export interface EnumItem extends EnumDefineOpt {
|
|
136
|
+
mode: LoaderMode;
|
|
137
|
+
type?: EnumType;
|
|
138
|
+
data?: EnumMap | EnumLiteral;
|
|
139
|
+
alt?: EnumAlt;
|
|
140
|
+
lazyData?: Promise<EnumMap | EnumLiteral>;
|
|
141
|
+
lazyAlt?: Promise<EnumAlt>;
|
|
142
|
+
}
|
|
143
|
+
export interface EnumDefineOpt {
|
|
144
|
+
name: string;
|
|
145
|
+
fqn?: string;
|
|
146
|
+
i18n?: unknown;
|
|
147
|
+
}
|
|
148
|
+
export interface EnumDefineEagerOpt extends EnumDefineOpt {
|
|
149
|
+
alt?: EnumAlt;
|
|
150
|
+
}
|
|
151
|
+
export interface EnumDefineLazyOpt extends EnumDefineOpt {
|
|
152
|
+
lazyData: Promise<EnumMap | EnumLiteral>;
|
|
153
|
+
lazyAlt?: Promise<EnumAlt>;
|
|
154
|
+
}
|
|
155
|
+
export type IgnoreFieldsByType<T, I> = {
|
|
156
|
+
[K in keyof T]: T[K] extends I ? K : never;
|
|
157
|
+
}[keyof T];
|
|
158
|
+
export type ReplaceType<T, O, N> = {
|
|
159
|
+
[P in keyof T]: T[P] extends O ? N : T[P];
|
|
160
|
+
};
|
|
161
|
+
export type SameType<A, T> = {
|
|
162
|
+
[K in keyof A]: T;
|
|
163
|
+
};
|
|
164
|
+
export type PickByType<T, I> = {
|
|
165
|
+
[K in keyof T]: T[K] extends I ? K : never;
|
|
166
|
+
};
|
|
167
|
+
export type PickKeyByType<T, I> = PickByType<T, I>[keyof T];
|
|
168
|
+
export type OmitByType<T, I> = {
|
|
169
|
+
[K in keyof T]: T[K] extends I ? never : K;
|
|
170
|
+
};
|
|
171
|
+
export type OmitKeysByType<T, I> = OmitByType<T, I>[keyof T];
|
|
172
|
+
export type ValueOrCallback<T> = T | ValueCallback<T> | ValueCallbackAsync<T>;
|
|
173
|
+
export type ValueCallback<T> = () => T;
|
|
174
|
+
export type ValueCallbackAsync<T> = () => Promise<T>;
|
|
175
|
+
export type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T ? {
|
|
176
|
+
[P in K]: T[K];
|
|
177
|
+
} & Partial<Record<Exclude<keyof T, K>, never>> : never;
|
|
178
|
+
export type OneOf<Obj> = ValueOf<OneOfByKey<Obj>>;
|
|
179
|
+
export type Xor<A, B> = XorIn<A & {
|
|
180
|
+
[K in keyof B]?: undefined;
|
|
181
|
+
}> | XorIn<B & {
|
|
182
|
+
[K in keyof A]?: undefined;
|
|
183
|
+
}>;
|
|
184
|
+
type OneOnly<T, K extends keyof T> = Omit<T, Exclude<keyof T, K>> | Pick<T, K>;
|
|
185
|
+
type OneOfByKey<T> = {
|
|
186
|
+
[key in keyof T]: OneOnly<T, key>;
|
|
187
|
+
};
|
|
188
|
+
type XorIn<T> = {
|
|
189
|
+
[K in keyof T]: T[K];
|
|
190
|
+
} & unknown;
|
|
191
|
+
/**
|
|
192
|
+
* JSON Object, record of `JsonValue`
|
|
193
|
+
*
|
|
194
|
+
* @see #JsonValue
|
|
195
|
+
*/
|
|
196
|
+
export type JsonObject = {
|
|
197
|
+
[K in string]?: JsonValue;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* JSON Array, array of `JsonValue`
|
|
201
|
+
*
|
|
202
|
+
* @see #JsonValue
|
|
203
|
+
*/
|
|
204
|
+
export type JsonArray = Array<JsonValue>;
|
|
205
|
+
/**
|
|
206
|
+
* JSON Primitive
|
|
207
|
+
*
|
|
208
|
+
* `OneOf`
|
|
209
|
+
* @see `string`
|
|
210
|
+
* @see `number`
|
|
211
|
+
* @see `boolean`
|
|
212
|
+
* @see `null`
|
|
213
|
+
*/
|
|
214
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
215
|
+
/**
|
|
216
|
+
* JSON Value
|
|
217
|
+
*
|
|
218
|
+
* `OneOf`
|
|
219
|
+
* @see #JsonPrimitive
|
|
220
|
+
* @see #JsonObject
|
|
221
|
+
* @see #JsonArray
|
|
222
|
+
*/
|
|
223
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
224
|
+
export type OptReason = 'invalid' | 'unexpected' | 'not:allowed' | 'not:found' | 'duplicated' | 'empty' | 'conflicted';
|
|
225
|
+
export interface Opt<R extends string = string> extends Obj {
|
|
226
|
+
issue?: SetOrMore<OptReason | R | string>;
|
|
227
|
+
message?: SetOrMore<string>;
|
|
228
|
+
field?: string;
|
|
229
|
+
param?: SetOrMore<unknown>;
|
|
230
|
+
where?: SetOrMore<string>;
|
|
231
|
+
value?: SetOrMore<unknown>;
|
|
232
|
+
expected?: SetOrMore<ExtendedType | string>;
|
|
233
|
+
type?: SetOrMore<ExtendedType | string>;
|
|
234
|
+
method?: SetOrMore<string>;
|
|
235
|
+
case?: SetOrMore<unknown>;
|
|
236
|
+
desc?: SetOrMore<Describable | string>;
|
|
237
|
+
error?: SetOrMore<{
|
|
238
|
+
name: string;
|
|
239
|
+
message: string;
|
|
240
|
+
}>;
|
|
241
|
+
assert?: SetOrMore<string>;
|
|
242
|
+
[k: string]: unknown;
|
|
243
|
+
}
|
|
244
|
+
export type OptFn<O extends Opt = Opt> = () => O;
|
|
245
|
+
export type OptAny<O extends Opt = Opt> = O | OptFn<O>;
|
|
246
|
+
/**
|
|
247
|
+
* Extended array interface, ie: Clearable arrays
|
|
248
|
+
* */
|
|
249
|
+
export interface ListLike<T = unknown> extends Array<T> {
|
|
250
|
+
/**
|
|
251
|
+
* Clears array items, to align all iteration repositories, like Set, Map etc
|
|
252
|
+
*
|
|
253
|
+
* @return {number} - returns deleted count
|
|
254
|
+
* */
|
|
255
|
+
clear(): number;
|
|
256
|
+
/**
|
|
257
|
+
* Deletes given item
|
|
258
|
+
*
|
|
259
|
+
* @param {any} value - will be deleted record
|
|
260
|
+
* @return {boolean} - is deleted?
|
|
261
|
+
* */
|
|
262
|
+
delete(value: T): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Deletes by given predicate
|
|
265
|
+
*
|
|
266
|
+
* @param {function} predicate - lambda expression
|
|
267
|
+
* @return {boolean} - is deleted?
|
|
268
|
+
* */
|
|
269
|
+
deleteByLambda(predicate: ListPredicate<T>): boolean;
|
|
270
|
+
}
|
|
271
|
+
export type ListPredicate<T = unknown> = (value: T, index?: number, arr?: Array<T>) => T;
|
|
272
|
+
/**
|
|
273
|
+
* Bare omit error without any property
|
|
274
|
+
* */
|
|
275
|
+
export type OmitError = Omit<Error, 'name' | 'message' | 'stack'>;
|
|
276
|
+
export interface ErrorObject {
|
|
277
|
+
name: string;
|
|
278
|
+
message: string;
|
|
279
|
+
}
|
|
280
|
+
export interface ErrorItem extends ErrorDefineOpt {
|
|
281
|
+
name: string;
|
|
282
|
+
mode: LoaderMode;
|
|
283
|
+
clazz?: ClassLike;
|
|
284
|
+
lazyClass?: Promise<ClassLike>;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Stack line
|
|
288
|
+
* */
|
|
289
|
+
export interface ErrorStackLine {
|
|
290
|
+
/**
|
|
291
|
+
* File of error
|
|
292
|
+
* */
|
|
293
|
+
file: string;
|
|
294
|
+
/**
|
|
295
|
+
* Method of error
|
|
296
|
+
* */
|
|
297
|
+
method?: string;
|
|
298
|
+
/**
|
|
299
|
+
* Position of error
|
|
300
|
+
* */
|
|
301
|
+
pos?: string;
|
|
302
|
+
}
|
|
303
|
+
export interface LeyyoStackLike extends Error {
|
|
304
|
+
/**
|
|
305
|
+
* Formatted stack trace
|
|
306
|
+
* */
|
|
307
|
+
stackTrace?: Array<ErrorStackLine>;
|
|
308
|
+
}
|
|
309
|
+
export interface LeyyoErrorLike extends Error, LeyyoStackLike, ShiftSecure<LeyyoErrorSecure> {
|
|
310
|
+
/**
|
|
311
|
+
* Parameters for error
|
|
312
|
+
* */
|
|
313
|
+
params?: Opt;
|
|
314
|
+
/**
|
|
315
|
+
* Caused error
|
|
316
|
+
* */
|
|
317
|
+
causedBy?: OneOrMore<Error>;
|
|
318
|
+
/**
|
|
319
|
+
* Bind caused error
|
|
320
|
+
*
|
|
321
|
+
* @param {Error} err
|
|
322
|
+
* @return {LeyyoErrorLike}
|
|
323
|
+
* */
|
|
324
|
+
causes(err: Error): this;
|
|
325
|
+
/**
|
|
326
|
+
* Bind holder class name
|
|
327
|
+
*
|
|
328
|
+
* @param {string} name - name of class
|
|
329
|
+
* @param {string?} fqn - fqn
|
|
330
|
+
* @return {LeyyoErrorLike}
|
|
331
|
+
* */
|
|
332
|
+
where(name: string, fqn?: string): this;
|
|
333
|
+
/**
|
|
334
|
+
* Bind holder instance
|
|
335
|
+
*
|
|
336
|
+
* @param {Obj} instance - this instance
|
|
337
|
+
* @return {LeyyoErrorLike}
|
|
338
|
+
* */
|
|
339
|
+
where(instance: Obj): this;
|
|
340
|
+
/**
|
|
341
|
+
* Bind holder instance
|
|
342
|
+
*
|
|
343
|
+
* @param {function} clazz - class
|
|
344
|
+
* @return {LeyyoErrorLike}
|
|
345
|
+
* */
|
|
346
|
+
where(clazz: ClassLike): this;
|
|
347
|
+
/**
|
|
348
|
+
* Alias for {@link logError}
|
|
349
|
+
*
|
|
350
|
+
* @param {Logger?} logger - optional bound logger
|
|
351
|
+
* */
|
|
352
|
+
log(logger?: Logger): void;
|
|
353
|
+
/**
|
|
354
|
+
* Log as `fatal`
|
|
355
|
+
*
|
|
356
|
+
* @param {Logger?} logger - optional bound logger
|
|
357
|
+
* */
|
|
358
|
+
logFatal(logger?: Logger): void;
|
|
359
|
+
/**
|
|
360
|
+
* Log as `error`
|
|
361
|
+
*
|
|
362
|
+
* @param {Logger?} logger - optional bound logger
|
|
363
|
+
* */
|
|
364
|
+
logError(logger?: Logger): void;
|
|
365
|
+
/**
|
|
366
|
+
* Log as `warn`
|
|
367
|
+
*
|
|
368
|
+
* @param {Logger?} logger - optional bound logger
|
|
369
|
+
* */
|
|
370
|
+
logWarn(logger?: Logger): void;
|
|
371
|
+
/**
|
|
372
|
+
* Log as `debug`
|
|
373
|
+
*
|
|
374
|
+
* @param {Logger?} logger - optional bound logger
|
|
375
|
+
* */
|
|
376
|
+
logDebug(logger?: Logger): void;
|
|
377
|
+
/**
|
|
378
|
+
* Log as `info`
|
|
379
|
+
*
|
|
380
|
+
* @param {Logger?} logger - optional bound logger
|
|
381
|
+
* */
|
|
382
|
+
logInfo(logger?: Logger): void;
|
|
383
|
+
/**
|
|
384
|
+
* Log as `trace`
|
|
385
|
+
*
|
|
386
|
+
* @param {Logger?} logger - optional bound logger
|
|
387
|
+
* */
|
|
388
|
+
logTrace(logger?: Logger): void;
|
|
389
|
+
}
|
|
390
|
+
export interface LeyyoErrorSecure extends ShiftMain<LeyyoErrorLike> {
|
|
391
|
+
/**
|
|
392
|
+
* List flags
|
|
393
|
+
*
|
|
394
|
+
* @return {Array<string>} - flags
|
|
395
|
+
* */
|
|
396
|
+
$list<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(): Array<T>;
|
|
397
|
+
/**
|
|
398
|
+
* Append a flag
|
|
399
|
+
*
|
|
400
|
+
* @param {string} key - flag key
|
|
401
|
+
* @return {boolean} - is it appended?
|
|
402
|
+
* */
|
|
403
|
+
$append<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Remove a flag
|
|
406
|
+
*
|
|
407
|
+
* @param {string} key - flag key
|
|
408
|
+
* @return {boolean} - is it removed?
|
|
409
|
+
* */
|
|
410
|
+
$remove<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Has a flag?
|
|
413
|
+
*
|
|
414
|
+
* @param {string} key - flag key
|
|
415
|
+
* @return {boolean} - has it?
|
|
416
|
+
* */
|
|
417
|
+
$has<T extends LeyyoErrorTag | string = LeyyoErrorTag | string>(key: T): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Copy source properties into target parameters
|
|
420
|
+
*
|
|
421
|
+
* @param {Error} source - source error
|
|
422
|
+
* */
|
|
423
|
+
$copyProperties(source: Error): void;
|
|
424
|
+
}
|
|
425
|
+
export type LeyyoErrorTag = 'printed' | 'sent';
|
|
426
|
+
export interface ErrorDefineOpt {
|
|
427
|
+
/**
|
|
428
|
+
* Fqn name
|
|
429
|
+
* */
|
|
430
|
+
fqn?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Default error message
|
|
433
|
+
* */
|
|
434
|
+
message?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Will be error emitted?
|
|
437
|
+
* */
|
|
438
|
+
emit?: unknown;
|
|
439
|
+
/**
|
|
440
|
+
* Will be the error decorated for context language?
|
|
441
|
+
* */
|
|
442
|
+
i18n?: unknown;
|
|
443
|
+
}
|
|
444
|
+
export interface ErrorDefineEagerOpt extends ErrorDefineOpt {
|
|
445
|
+
}
|
|
446
|
+
export interface ErrorDefineLazyOpt extends ErrorDefineOpt {
|
|
447
|
+
name: string;
|
|
448
|
+
lazyClass: Promise<ClassLike>;
|
|
449
|
+
}
|
|
450
|
+
export type ErrorStackBuilder = (err: LeyyoStackLike, force?: boolean) => void;
|
|
451
|
+
export type LifecycleStage = 'initialize' | 'print' | 'validate' | 'process' | 'clear' | 'ota-before' | 'ota-after' | 'kill';
|
|
452
|
+
export type LifecycleTuple = [string, Array<Fnc>];
|
|
453
|
+
export type LifecycleSortLambda = (map: Map<string, Array<Fnc>>) => Array<LifecycleTuple>;
|
|
454
|
+
export type ExporterData = Record<string, ExporterValue>;
|
|
455
|
+
export type ExporterValue = Record<string, unknown>;
|
|
456
|
+
export interface ExporterDepot {
|
|
457
|
+
add(name: string, value: ExporterValue): void;
|
|
458
|
+
}
|
|
459
|
+
export interface Logger extends ShiftSecure<LoggerSecure> {
|
|
460
|
+
debug(message: string, params?: any | Opt): void;
|
|
461
|
+
debug(error: Error, params?: any | Opt): void;
|
|
462
|
+
debug(whatever: any, params?: any | Opt): void;
|
|
463
|
+
trace(message: string, params?: any | Opt): void;
|
|
464
|
+
trace(error: Error, params?: any | Opt): void;
|
|
465
|
+
trace(whatever: any, params?: any | Opt): void;
|
|
466
|
+
info(message: string, params?: any | Opt): void;
|
|
467
|
+
info(error: Error, params?: any | Opt): void;
|
|
468
|
+
info(whatever: any, params?: any | Opt): void;
|
|
469
|
+
warn(message: string, params?: any | Opt): void;
|
|
470
|
+
warn(error: Error, params?: any | Opt): void;
|
|
471
|
+
warn(whatever: any, params?: any | Opt): void;
|
|
472
|
+
error(message: string, params?: any | Opt): void;
|
|
473
|
+
error(error: Error, params?: any | Opt): void;
|
|
474
|
+
error(whatever: any, params?: any | Opt): void;
|
|
475
|
+
fatal(message: string, params?: any | Opt): void;
|
|
476
|
+
fatal(error: Error, params?: any | Opt): void;
|
|
477
|
+
fatal(whatever: any, params?: any | Opt): void;
|
|
478
|
+
}
|
|
479
|
+
export interface LoggerSecure extends ShiftMain<Logger> {
|
|
480
|
+
get $name(): string;
|
|
481
|
+
$refresh(level: LogLevel): void;
|
|
482
|
+
}
|
|
483
|
+
export interface LogItem {
|
|
484
|
+
level: LogLevel;
|
|
485
|
+
where?: string;
|
|
486
|
+
ctx?: unknown;
|
|
487
|
+
now: string;
|
|
488
|
+
message: string | Error;
|
|
489
|
+
params?: Opt;
|
|
490
|
+
paramStr?: string;
|
|
491
|
+
}
|
|
492
|
+
export type LocalColorLevel = [boolean, string, string];
|
|
493
|
+
export interface LocalColorLike {
|
|
494
|
+
bold: string;
|
|
495
|
+
normal: string;
|
|
496
|
+
end: string;
|
|
497
|
+
param: string;
|
|
498
|
+
levels: Record<LogLevel, LocalColorLevel>;
|
|
499
|
+
}
|
|
500
|
+
export type LogFormatterLambda = (item: LogItem) => void;
|
|
501
|
+
export type LogConsumerLambda = (item: LogItem) => void;
|
|
502
|
+
export type LogStylerLambda = (item: LogItem) => string;
|
|
503
|
+
export type ContextFinderLambda = <T = unknown>(...p: Array<unknown>) => T;
|
|
504
|
+
export type LoaderMode = 'eager' | 'lazy';
|
|
505
|
+
export type LoaderLike = Array<LoaderItem>;
|
|
506
|
+
export type LeyyoStampLambda = () => LoaderItem;
|
|
507
|
+
export type LeyyoStampEmpty = () => symbol;
|
|
508
|
+
export type LoaderItem = ClassLike | Fnc | EnumMap | EnumLiteral | Obj | LeyyoStampLambda | LeyyoStampEmpty | LoaderLike;
|
|
509
|
+
export type EventType = 'log' | 'error:emit' | 'context:finder';
|
|
510
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../src/index.types.ts"],"names":[],"mappings":";AAAA,qCAAqC;;AA6oBrC,kBAAkB;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE"}
|
package/dist/loader.d.ts
ADDED
package/dist/loader.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.foretell_leyyoCommon = exports.loader_leyyoCommon = void 0;
|
|
37
|
+
const internal_1 = require("./internal");
|
|
38
|
+
const common_1 = require("./common");
|
|
39
|
+
// noinspection JSUnusedGlobalSymbols
|
|
40
|
+
exports.loader_leyyoCommon = (0, common_1.defineLoader)(internal_1.FQN,
|
|
41
|
+
// errors
|
|
42
|
+
() => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.HttpError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.InvalidValueError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.LeyyoError), () => Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.MultipleError),
|
|
43
|
+
// enums
|
|
44
|
+
() => Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems),
|
|
45
|
+
// classes
|
|
46
|
+
() => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.List), () => Promise.resolve().then(() => __importStar(require('./class'))).then(m => m.LoggerInstance));
|
|
47
|
+
// noinspection JSUnusedGlobalSymbols
|
|
48
|
+
exports.foretell_leyyoCommon = [
|
|
49
|
+
() => (0, common_1.defineLazyError)({
|
|
50
|
+
name: 'CausedError',
|
|
51
|
+
fqn: internal_1.FQN,
|
|
52
|
+
i18n: true,
|
|
53
|
+
emit: true,
|
|
54
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
55
|
+
}),
|
|
56
|
+
() => (0, common_1.defineLazyError)({
|
|
57
|
+
name: 'DeveloperError',
|
|
58
|
+
fqn: internal_1.FQN,
|
|
59
|
+
i18n: false,
|
|
60
|
+
emit: true,
|
|
61
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.DeveloperError)
|
|
62
|
+
}),
|
|
63
|
+
() => (0, common_1.defineLazyError)({
|
|
64
|
+
name: 'CausedError',
|
|
65
|
+
fqn: internal_1.FQN,
|
|
66
|
+
i18n: true,
|
|
67
|
+
emit: true,
|
|
68
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
69
|
+
}),
|
|
70
|
+
() => (0, common_1.defineLazyError)({
|
|
71
|
+
name: 'CausedError',
|
|
72
|
+
fqn: internal_1.FQN,
|
|
73
|
+
i18n: true,
|
|
74
|
+
emit: true,
|
|
75
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
76
|
+
}),
|
|
77
|
+
() => (0, common_1.defineLazyError)({
|
|
78
|
+
name: 'CausedError',
|
|
79
|
+
fqn: internal_1.FQN,
|
|
80
|
+
i18n: true,
|
|
81
|
+
emit: true,
|
|
82
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
83
|
+
}),
|
|
84
|
+
() => (0, common_1.defineLazyError)({
|
|
85
|
+
name: 'CausedError',
|
|
86
|
+
fqn: internal_1.FQN,
|
|
87
|
+
i18n: true,
|
|
88
|
+
emit: true,
|
|
89
|
+
lazyClass: Promise.resolve().then(() => __importStar(require('./error'))).then(m => m.CausedError)
|
|
90
|
+
}),
|
|
91
|
+
() => (0, common_1.defineLazyEnum)({
|
|
92
|
+
name: 'LogLevel',
|
|
93
|
+
fqn: internal_1.FQN,
|
|
94
|
+
i18n: true,
|
|
95
|
+
lazyData: Promise.resolve().then(() => __importStar(require('./enum'))).then(m => m.LogLevelItems)
|
|
96
|
+
})
|
|
97
|
+
];
|
|
98
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leyyo/common",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "Leyyo common library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"common"
|
|
7
7
|
],
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"lint": "eslint src/**/*.ts",
|
|
23
23
|
"asset": "node -r ts-node/register commands/assets.ts",
|
|
24
24
|
"build": "npm run clear && tsc && npm run asset",
|
|
25
|
-
"test": "jest --config=jest.json --verbose",
|
|
25
|
+
"test": "npx jest --config=jest.json --clearCache && npx jest --config=jest.json --verbose",
|
|
26
26
|
"test:watch": "jest --watch --config=jest.json",
|
|
27
27
|
"test:coverage": "jest --config=jest.json --coverage --coverageDirectory=coverage",
|
|
28
28
|
"~publish": "npm run build && npm publish -access=public"
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/preset-typescript": "^7.27.0",
|
|
36
|
+
"@types/express": "^5.0.6",
|
|
37
|
+
"@types/geoip-lite": "^1.4.4",
|
|
36
38
|
"@types/jest": "^29.5.14",
|
|
37
39
|
"@types/node": "^22.14.0",
|
|
38
40
|
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
package/dist/$$leyyo-loader.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const $$leyyoLoader: import("./shared").LoaderLike;
|