@leyyo/common 1.0.9 → 1.0.11
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/dist/assertion/{common-assertion.d.ts → assertion.common.d.ts} +7 -7
- package/dist/assertion/{common-assertion.js → assertion.common.js} +5 -5
- package/dist/assertion/{common-assertion.js.map → assertion.common.js.map} +1 -1
- package/dist/assertion/index.types.d.ts +32 -32
- package/dist/config/config.common.d.ts +16 -0
- package/dist/config/{common-config.js → config.common.js} +5 -5
- package/dist/config/{common-config.js.map → config.common.js.map} +1 -1
- package/dist/config/index.types.d.ts +3 -3
- package/dist/deploy/{common-deploy.d.ts → deploy.common.d.ts} +8 -8
- package/dist/deploy/{common-deploy.js → deploy.common.js} +5 -5
- package/dist/deploy/{common-deploy.js.map → deploy.common.js.map} +1 -1
- package/dist/deploy/index.types.d.ts +6 -6
- package/dist/descriptor/{common-descriptor.d.ts → descriptor.common.d.ts} +6 -6
- package/dist/descriptor/{common-descriptor.js → descriptor.common.js} +5 -5
- package/dist/descriptor/{common-descriptor.js.map → descriptor.common.js.map} +1 -1
- package/dist/descriptor/index.types.d.ts +3 -3
- package/dist/developer/{common-developer.d.ts → developer.common.d.ts} +7 -7
- package/dist/developer/{common-developer.js → developer.common.js} +5 -5
- package/dist/developer/{common-developer.js.map → developer.common.js.map} +1 -1
- package/dist/developer/index.errors.d.ts +1 -1
- package/dist/developer/index.types.d.ts +4 -4
- package/dist/env/env.common.d.ts +14 -0
- package/dist/env/env.common.js +52 -0
- package/dist/env/env.common.js.map +1 -0
- package/dist/env/env.instance.d.ts +5 -0
- package/dist/env/env.instance.js +10 -0
- package/dist/env/env.instance.js.map +1 -0
- package/dist/env/index.d.ts +1 -0
- package/dist/env/index.js +18 -0
- package/dist/env/index.js.map +1 -0
- package/dist/env/index.types.d.ts +20 -0
- package/dist/env/index.types.js +3 -0
- package/dist/env/index.types.js.map +1 -0
- package/dist/error/{common-error.d.ts → error.common.d.ts} +7 -7
- package/dist/error/{common-error.js → error.common.js} +8 -8
- package/dist/error/{common-error.js.map → error.common.js.map} +1 -1
- package/dist/error/index.types.d.ts +5 -5
- package/dist/exception/{assertion-exception.d.ts → assertion.exception.d.ts} +1 -1
- package/dist/exception/{assertion-exception.js → assertion.exception.js} +1 -1
- package/dist/exception/assertion.exception.js.map +1 -0
- package/dist/exception/{caused-exception.d.ts → caused.exception.d.ts} +1 -1
- package/dist/exception/{caused-exception.js → caused.exception.js} +1 -1
- package/dist/exception/{caused-exception.js.map → caused.exception.js.map} +1 -1
- package/dist/exception/{developer-exception.d.ts → developer.exception.d.ts} +1 -1
- package/dist/exception/{developer-exception.js → developer.exception.js} +1 -1
- package/dist/exception/developer.exception.js.map +1 -0
- package/dist/exception/exception.d.ts +5 -5
- package/dist/exception/index.d.ts +5 -5
- package/dist/exception/index.js +5 -5
- package/dist/exception/index.types.d.ts +1 -1
- package/dist/exception/{invalid-value-exception.d.ts → invalid-value.exception.d.ts} +1 -1
- package/dist/exception/{invalid-value-exception.js → invalid-value.exception.js} +1 -1
- package/dist/exception/invalid-value.exception.js.map +1 -0
- package/dist/exception/{multiple-exception.d.ts → multiple.exception.d.ts} +1 -1
- package/dist/exception/{multiple-exception.js → multiple.exception.js} +1 -1
- package/dist/exception/{multiple-exception.js.map → multiple.exception.js.map} +1 -1
- package/dist/fqn/fqn.common.d.ts +20 -0
- package/dist/fqn/{common-fqn.js → fqn.common.js} +8 -8
- package/dist/fqn/{common-fqn.js.map → fqn.common.js.map} +1 -1
- package/dist/fqn/index.types.d.ts +7 -7
- package/dist/hook/{common-hook.d.ts → hook.common.d.ts} +6 -6
- package/dist/hook/{common-hook.js → hook.common.js} +13 -13
- package/dist/hook/{common-hook.js.map → hook.common.js.map} +1 -1
- package/dist/hook/index.types.d.ts +3 -3
- package/dist/index.d.ts +18 -18
- package/dist/index.js.map +1 -1
- package/dist/is/index.types.d.ts +3 -3
- package/dist/is/{common-is.d.ts → is.common.d.ts} +6 -6
- package/dist/is/{common-is.js → is.common.js} +5 -5
- package/dist/is/{common-is.js.map → is.common.js.map} +1 -1
- package/dist/leyyo/index.d.ts +1 -1
- package/dist/leyyo/index.js +1 -1
- package/dist/leyyo/index.types.d.ts +35 -35
- package/dist/leyyo/{leyyo-common-hook.d.ts → leyyo-hook.common.d.ts} +1 -1
- package/dist/leyyo/leyyo-hook.common.js +18 -0
- package/dist/leyyo/{leyyo-common-hook.js.map → leyyo-hook.common.js.map} +1 -1
- package/dist/leyyo/leyyo.d.ts +36 -36
- package/dist/leyyo/leyyo.js +34 -34
- package/dist/leyyo/leyyo.js.map +1 -1
- package/dist/log/index.d.ts +1 -1
- package/dist/log/index.js +1 -1
- package/dist/log/index.types.d.ts +8 -8
- package/dist/log/log.common.d.ts +15 -0
- package/dist/log/{common-log.js → log.common.js} +10 -10
- package/dist/log/{common-log.js.map → log.common.js.map} +1 -1
- package/dist/log/{logger-instance.d.ts → logger.instance.d.ts} +6 -6
- package/dist/log/{logger-instance.js → logger.instance.js} +1 -1
- package/dist/log/{logger-instance.js.map → logger.instance.js.map} +1 -1
- package/dist/mixin/index.types.d.ts +4 -4
- package/dist/mixin/{common-mixin.d.ts → mixin.common.d.ts} +6 -7
- package/dist/mixin/{common-mixin.js → mixin.common.js} +5 -5
- package/dist/mixin/{common-mixin.js.map → mixin.common.js.map} +1 -1
- package/dist/name/index.types.d.ts +3 -3
- package/dist/name/{common-name.d.ts → name.common.d.ts} +6 -6
- package/dist/name/{common-name.js → name.common.js} +5 -5
- package/dist/name/{common-name.js.map → name.common.js.map} +1 -1
- package/dist/repo/index.types.d.ts +9 -9
- package/dist/repo/{common-repo.d.ts → repo.common.d.ts} +7 -7
- package/dist/repo/{common-repo.js → repo.common.js} +5 -5
- package/dist/repo/{common-repo.js.map → repo.common.js.map} +1 -1
- package/dist/shared/index.types.d.ts +32 -26
- package/dist/shared/index.types.js +1 -0
- package/dist/shared/index.types.js.map +1 -1
- package/dist/system/index.types.d.ts +3 -3
- package/dist/system/system.common.d.ts +11 -0
- package/dist/system/{common-system.js → system.common.js} +6 -6
- package/dist/system/{common-system.js.map → system.common.js.map} +1 -1
- package/dist/test/index.types.d.ts +3 -3
- package/dist/test/test.common.d.ts +14 -0
- package/dist/test/{common-test.js → test.common.js} +5 -5
- package/dist/test/{common-test.js.map → test.common.js.map} +1 -1
- package/dist/to/index.types.d.ts +10 -6
- package/dist/to/{common-to.d.ts → to.common.d.ts} +10 -6
- package/dist/to/{common-to.js → to.common.js} +44 -6
- package/dist/to/{common-to.js.map → to.common.js.map} +1 -1
- package/dist/wrapper/index.types.d.ts +3 -3
- package/dist/wrapper/wrap.d.ts +2 -2
- package/dist/wrapper/{common-wrapper.d.ts → wrapper.common.d.ts} +6 -6
- package/dist/wrapper/{common-wrapper.js → wrapper.common.js} +5 -5
- package/dist/wrapper/{common-wrapper.js.map → wrapper.common.js.map} +1 -1
- package/package.json +1 -1
- package/dist/config/common-config.d.ts +0 -16
- package/dist/exception/assertion-exception.js.map +0 -1
- package/dist/exception/developer-exception.js.map +0 -1
- package/dist/exception/invalid-value-exception.js.map +0 -1
- package/dist/fqn/common-fqn.d.ts +0 -20
- package/dist/leyyo/leyyo-common-hook.js +0 -18
- package/dist/log/common-log.d.ts +0 -15
- package/dist/system/common-system.d.ts +0 -11
- package/dist/test/common-test.d.ts +0 -14
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CommonRepoDetail, CommonRepoItem, CommonRepoLike, CommonRepoSecure, RepoType } from "./index.types";
|
|
2
|
-
import { LeyyoLike } from "../leyyo";
|
|
3
1
|
import { List } from "../to";
|
|
2
|
+
import type { RepoCommonLike, RepoCommonSecure, RepoDetail, RepoItem, RepoType } from "./index.types";
|
|
3
|
+
import type { LeyyoLike } from "../leyyo";
|
|
4
4
|
/** @inheritDoc */
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class RepoCommon implements RepoCommonLike, RepoCommonSecure {
|
|
6
6
|
private lyy;
|
|
7
7
|
private readonly _lists;
|
|
8
8
|
private readonly _arrays;
|
|
@@ -39,9 +39,9 @@ export declare class CommonRepo implements CommonRepoLike, CommonRepoSecure {
|
|
|
39
39
|
/** @inheritDoc */
|
|
40
40
|
getRecord<K extends string | symbol, V>(collection: symbol): Record<K, V>;
|
|
41
41
|
/** @inheritDoc */
|
|
42
|
-
detailItem(type: RepoType, collection?: symbol):
|
|
42
|
+
detailItem(type: RepoType, collection?: symbol): RepoItem;
|
|
43
43
|
/** @inheritDoc */
|
|
44
|
-
details(type?: RepoType, collection?: symbol):
|
|
45
|
-
get $back():
|
|
46
|
-
get $secure():
|
|
44
|
+
details(type?: RepoType, collection?: symbol): RepoDetail;
|
|
45
|
+
get $back(): RepoCommonLike;
|
|
46
|
+
get $secure(): RepoCommonSecure;
|
|
47
47
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RepoCommon = void 0;
|
|
4
4
|
const internal_1 = require("../internal");
|
|
5
5
|
const to_1 = require("../to");
|
|
6
6
|
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
7
7
|
/** @inheritDoc */
|
|
8
|
-
class
|
|
8
|
+
class RepoCommon {
|
|
9
9
|
/**
|
|
10
10
|
* Default constructor
|
|
11
11
|
*
|
|
@@ -22,7 +22,7 @@ class CommonRepo {
|
|
|
22
22
|
}
|
|
23
23
|
$init() {
|
|
24
24
|
this.lyy.$secure.$lazyRun(() => {
|
|
25
|
-
this.lyy.fqn.register(null,
|
|
25
|
+
this.lyy.fqn.register(null, RepoCommon, 'class', internal_1.FQN);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
_addDetail(map, result, collection, fn) {
|
|
@@ -162,5 +162,5 @@ class CommonRepo {
|
|
|
162
162
|
return this;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
exports.
|
|
166
|
-
//# sourceMappingURL=
|
|
165
|
+
exports.RepoCommon = RepoCommon;
|
|
166
|
+
//# sourceMappingURL=repo.common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"repo.common.js","sourceRoot":"","sources":["../../src/repo/repo.common.ts"],"names":[],"mappings":";;;AAAA,0CAAgC;AAChC,8BAA2B;AAM3B,0DAA0D;AAC1D,kBAAkB;AAClB,MAAa,UAAU;IAOnB;;;;;SAKK;IACL,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;QAZjB,WAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;QAC1C,YAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC5C,UAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;QACjD,UAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;QACxC,aAAQ,GAAG,IAAI,GAAG,EAA0C,CAAC;IAS9E,CAAC;IAED,KAAK;QAED,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,cAAG,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,UAAU,CAAC,GAAkB,EAAE,MAAgB,EAAE,UAAkB,EAAE,EAAoB;QAC7F,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,IAAI,UAAU,EAAE,CAAC;gBACb,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC;iBACI,CAAC;gBACF,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACrB,CAAC;YACD,OAAO;QACX,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACb,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,GA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guageCode, LocaleCode } from "../system";
|
|
2
2
|
export type BasicType = 'undefined' | 'string' | 'object' | 'number' | 'boolean' | 'function' | 'symbol' | 'bigint';
|
|
3
|
-
export type Dict<T =
|
|
4
|
-
export type Arr<T =
|
|
3
|
+
export type Dict<T = unknown> = Record<KeyValue, T>;
|
|
4
|
+
export type Arr<T = unknown> = Array<T>;
|
|
5
5
|
export type KeyValue = string | number;
|
|
6
6
|
export type Id = string | number;
|
|
7
7
|
export type Unknown = unknown;
|
|
@@ -27,22 +27,22 @@ export type IsoTime = string;
|
|
|
27
27
|
interface _BaseFunc {
|
|
28
28
|
readonly name?: string;
|
|
29
29
|
readonly length?: number;
|
|
30
|
-
bind(thisArg:
|
|
31
|
-
apply(thisArg:
|
|
32
|
-
call(thisArg:
|
|
30
|
+
bind(thisArg: unknown, ...args: Array<unknown>): unknown;
|
|
31
|
+
apply(thisArg: unknown, args: Array<unknown>): unknown;
|
|
32
|
+
call(thisArg: unknown, ...args: Array<unknown>): unknown;
|
|
33
33
|
}
|
|
34
34
|
interface _SyncFnc<R> extends _BaseFunc {
|
|
35
|
-
(...args: Array<
|
|
35
|
+
(...args: Array<unknown>): R;
|
|
36
36
|
}
|
|
37
37
|
interface _AsyncFnc<R> extends _BaseFunc {
|
|
38
|
-
(...args: Array<
|
|
38
|
+
(...args: Array<unknown>): Promise<R>;
|
|
39
39
|
}
|
|
40
|
-
export type Fnc<R =
|
|
41
|
-
export type Async<R =
|
|
42
|
-
export type AnyFnc<R =
|
|
40
|
+
export type Fnc<R = unknown> = _SyncFnc<R> & Function;
|
|
41
|
+
export type Async<R = unknown> = _AsyncFnc<R> & AsyncGeneratorFunction;
|
|
42
|
+
export type AnyFnc<R = unknown> = Fnc<R> | Async<R>;
|
|
43
43
|
export type _Type<T> = {
|
|
44
|
-
new (...args: Array<
|
|
45
|
-
prototype?:
|
|
44
|
+
new (...args: Array<unknown>): T;
|
|
45
|
+
prototype?: unknown;
|
|
46
46
|
};
|
|
47
47
|
export type ClassLike<T = {}> = (_BaseFunc & _Type<T>) | _SyncFnc<T>;
|
|
48
48
|
export type TypeOf<C = ClassLike> = C extends ClassLike<infer T> ? T : C;
|
|
@@ -52,12 +52,6 @@ export interface Describable {
|
|
|
52
52
|
export interface Nameable {
|
|
53
53
|
name: string;
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Serialized version of another type
|
|
57
|
-
*/
|
|
58
|
-
export type Serialized<T> = {
|
|
59
|
-
[P in keyof T]: T[P];
|
|
60
|
-
};
|
|
61
55
|
export type ClassOrName = ClassLike | string;
|
|
62
56
|
export type FuncOrName = Function | string;
|
|
63
57
|
export type ClassOrFuncOrName = ClassLike | Function | string;
|
|
@@ -88,16 +82,10 @@ export type Xor<A, B> = XorIn<A & {
|
|
|
88
82
|
}> | XorIn<B & {
|
|
89
83
|
[K in keyof A]?: undefined;
|
|
90
84
|
}>;
|
|
91
|
-
export type Mutable<A> = {
|
|
92
|
-
-readonly [K in keyof A]: A[K];
|
|
93
|
-
};
|
|
94
85
|
export type OneOrMore<T> = T | Array<T>;
|
|
95
86
|
export type ValueOrCallback<T> = T | ValueCallback<T> | ValueCallbackAsync<T>;
|
|
96
87
|
export type ValueCallback<T> = () => T;
|
|
97
88
|
export type ValueCallbackAsync<T> = () => Promise<T>;
|
|
98
|
-
export type SameType<A, T> = {
|
|
99
|
-
[K in keyof A]: T;
|
|
100
|
-
};
|
|
101
89
|
type OneOnly<T, K extends keyof T> = Omit<T, Exclude<keyof T, K>> | Pick<T, K>;
|
|
102
90
|
type OneOfByKey<T> = {
|
|
103
91
|
[key in keyof T]: OneOnly<T, key>;
|
|
@@ -180,5 +168,23 @@ export type I18nRaw<V = unknown> = Dict<V>;
|
|
|
180
168
|
export type I18nAny<V = unknown> = I18nRaw<V> | V;
|
|
181
169
|
export type EnumMap<E extends KeyValue = KeyValue> = Dict<E>;
|
|
182
170
|
export type EnumAlt<E extends KeyValue = KeyValue> = Dict<E>;
|
|
183
|
-
export type EnumLiteral<E extends KeyValue = KeyValue> = Array<E> |
|
|
171
|
+
export type EnumLiteral<E extends KeyValue = KeyValue> = Array<E> | unknown;
|
|
172
|
+
export type IgnoreFieldsByType<T, I> = {
|
|
173
|
+
[K in keyof T]: T[K] extends I ? K : never;
|
|
174
|
+
}[keyof T];
|
|
175
|
+
export type ReplaceType<T, O, N> = {
|
|
176
|
+
[P in keyof T]: T[P] extends O ? N : T[P];
|
|
177
|
+
};
|
|
178
|
+
export type SameType<A, T> = {
|
|
179
|
+
[K in keyof A]: T;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Serialized version of another type
|
|
183
|
+
*/
|
|
184
|
+
export type Serialized<T> = {
|
|
185
|
+
[P in keyof T]: T[P];
|
|
186
|
+
};
|
|
187
|
+
export type Mutable<A> = {
|
|
188
|
+
-readonly [K in keyof A]: A[K];
|
|
189
|
+
};
|
|
184
190
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/shared/index.types.ts"],"names":[],"mappings":";AAAA,qCAAqC"}
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/shared/index.types.ts"],"names":[],"mappings":";AAAA,qCAAqC;;AAsPrC,YAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
export interface
|
|
1
|
+
import type { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
export interface SystemCommonLike extends ShiftSecure<SystemCommonSecure> {
|
|
3
3
|
isSysFunction(method: string): boolean;
|
|
4
4
|
isSysClass(clazz: string | Function): boolean;
|
|
5
5
|
}
|
|
6
|
-
export type
|
|
6
|
+
export type SystemCommonSecure = ShiftMain<SystemCommonLike> & InitLike;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SystemCommonLike, SystemCommonSecure } from "./index.types";
|
|
2
|
+
import { type LeyyoLike } from "../leyyo";
|
|
3
|
+
export declare class SystemCommon implements SystemCommonLike, SystemCommonSecure {
|
|
4
|
+
private lyy;
|
|
5
|
+
constructor(lyy: LeyyoLike);
|
|
6
|
+
get $back(): SystemCommonLike;
|
|
7
|
+
$init(): void;
|
|
8
|
+
get $secure(): SystemCommonSecure;
|
|
9
|
+
isSysFunction(method: string): boolean;
|
|
10
|
+
isSysClass(clazz: string | Function): boolean;
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SystemCommon = void 0;
|
|
4
4
|
const leyyo_1 = require("../leyyo");
|
|
5
5
|
const internal_1 = require("../internal");
|
|
6
6
|
const environment_1 = require("./environment");
|
|
@@ -10,7 +10,7 @@ const locale_code_1 = require("./locale-code");
|
|
|
10
10
|
const sys_class_1 = require("./sys-class");
|
|
11
11
|
const sys_function_1 = require("./sys-function");
|
|
12
12
|
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
13
|
-
class
|
|
13
|
+
class SystemCommon {
|
|
14
14
|
constructor(lyy) {
|
|
15
15
|
this.lyy = lyy;
|
|
16
16
|
}
|
|
@@ -20,7 +20,7 @@ class CommonSystem {
|
|
|
20
20
|
$init() {
|
|
21
21
|
this.lyy.$secure
|
|
22
22
|
.$lazyRun(() => {
|
|
23
|
-
this.lyy.fqn.register(null,
|
|
23
|
+
this.lyy.fqn.register(null, SystemCommon, 'class', internal_1.FQN);
|
|
24
24
|
})
|
|
25
25
|
.$lazyRun(() => {
|
|
26
26
|
const enumMap = {
|
|
@@ -33,7 +33,7 @@ class CommonSystem {
|
|
|
33
33
|
};
|
|
34
34
|
for (const [name, value] of Object.entries(enumMap)) {
|
|
35
35
|
this.lyy.fqn.register(name, value, 'enum', internal_1.FQN);
|
|
36
|
-
this.lyy.hook.queueForCallback(leyyo_1.
|
|
36
|
+
this.lyy.hook.queueForCallback(leyyo_1.LeyyoHookCommon.enumPendingRegister, value);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -60,5 +60,5 @@ class CommonSystem {
|
|
|
60
60
|
return sys_class_1.SysClassItems.includes(name);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
exports.
|
|
64
|
-
//# sourceMappingURL=
|
|
63
|
+
exports.SystemCommon = SystemCommon;
|
|
64
|
+
//# sourceMappingURL=system.common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"system.common.js","sourceRoot":"","sources":["../../src/system/system.common.ts"],"names":[],"mappings":";;;AACA,oCAAyD;AACzD,0CAAgC;AAChC,+CAA+C;AAC/C,iDAAgD;AAChD,mDAAkD;AAClD,+CAA8C;AAC9C,2CAAyD;AACzD,iDAAkE;AAElE,0DAA0D;AAC1D,MAAa,YAAY;IAErB,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAClC,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK;QACD,IAAI,CAAC,GAAG,CAAC,OAAO;aACX,QAAQ,CAAC,GAAG,EAAE;YACX,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,cAAG,CAAC,CAAC;QAChE,CAAC,CAAC;aACG,QAAQ,CAAC,GAAG,EAAE;YACf,MAAM,OAAO,GAAG;gBACZ,WAAW,EAAE,8BAAgB;gBAC7B,WAAW,EAAE,+BAAgB;gBAC7B,YAAY,EAAE,iCAAiB;gBAC/B,UAAU,EAAE,6BAAe;gBAC3B,QAAQ,EAAE,yBAAa;gBACvB,WAAW,EAAE,+BAAgB;aAChC,CAAC;YACF,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;gBAClD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,cAAG,CAAC,CAAC;gBAChD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,uBAAe,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;YAC/E,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,aAAa,CAAC,MAAc;QACxB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,+BAAgB,CAAC,QAAQ,CAAC,MAAqB,CAAC,CAAC;IAC5D,CAAC;IAED,UAAU,CAAC,KAAwB;QAC/B,IAAI,IAAY,CAAC;QACjB,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAC9B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACtB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,GAAG,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,yBAAa,CAAC,QAAQ,CAAC,IAAgB,CAAC,CAAC;IACpD,CAAC;CAEJ;AAtDD,oCAsDC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
export interface
|
|
1
|
+
import type { InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
export interface TestCommonLike extends ShiftSecure<TestCommonSecure> {
|
|
3
3
|
title(testCase: string | number, title: string): string;
|
|
4
4
|
code(pck: string, testCase: string | number): string;
|
|
5
5
|
get is(): boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface TestCommonSecure extends ShiftMain<TestCommonLike>, InitLike {
|
|
8
8
|
$ok(): void;
|
|
9
9
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TestCommonLike, TestCommonSecure } from "./index.types";
|
|
2
|
+
import type { LeyyoLike } from "../leyyo";
|
|
3
|
+
export declare class TestCommon implements TestCommonLike, TestCommonSecure {
|
|
4
|
+
private lyy;
|
|
5
|
+
private _is;
|
|
6
|
+
constructor(lyy: LeyyoLike);
|
|
7
|
+
get $back(): TestCommonLike;
|
|
8
|
+
$init(): void;
|
|
9
|
+
get $secure(): TestCommonSecure;
|
|
10
|
+
title(testCase: string | number, title: string): string;
|
|
11
|
+
code(pck: string, testCase: string | number): string;
|
|
12
|
+
get is(): boolean;
|
|
13
|
+
$ok(): void;
|
|
14
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TestCommon = void 0;
|
|
4
4
|
const internal_1 = require("../internal");
|
|
5
5
|
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
6
|
-
class
|
|
6
|
+
class TestCommon {
|
|
7
7
|
constructor(lyy) {
|
|
8
8
|
this.lyy = lyy;
|
|
9
9
|
}
|
|
@@ -12,7 +12,7 @@ class CommonTest {
|
|
|
12
12
|
}
|
|
13
13
|
$init() {
|
|
14
14
|
this.lyy.$secure.$lazyRun(() => {
|
|
15
|
-
this.lyy.fqn.register(null,
|
|
15
|
+
this.lyy.fqn.register(null, TestCommon, 'class', internal_1.FQN);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
get $secure() {
|
|
@@ -44,5 +44,5 @@ class CommonTest {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.
|
|
48
|
-
//# sourceMappingURL=
|
|
47
|
+
exports.TestCommon = TestCommon;
|
|
48
|
+
//# sourceMappingURL=test.common.js.map
|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AC,MAAM,CAAC,gBAAgB,EAAE,CAAC;gBAC3B,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;gBAE/B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBACxE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;oBAClC,CAAC,CAAC;oBACF,OAAO,CAAC,IAAI,CAAC,GAAG,GAAS,EAAE;oBAC3B,CAAC,CAAC;gBACN,CAAC,CAAC,CAAC;YAEP,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA/CD,gCA+CC"}
|
package/dist/to/index.types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Dict, EnumAlt, EnumLiteral, EnumMap, Fnc, InitLike, KeyValue, Obj, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
-
import { DevOpt } from "../developer";
|
|
3
|
-
import { WeakTrue } from "./weak-true";
|
|
4
|
-
import { WeakFalse } from "./weak-false";
|
|
1
|
+
import type { Dict, EnumAlt, EnumLiteral, EnumMap, Fnc, InitLike, KeyValue, Obj, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
import type { DevOpt } from "../developer";
|
|
3
|
+
import type { WeakTrue } from "./weak-true";
|
|
4
|
+
import type { WeakFalse } from "./weak-false";
|
|
5
5
|
import { List } from "./list";
|
|
6
|
-
export interface
|
|
6
|
+
export interface ToCommonLike extends ShiftSecure<ToCommonSecure> {
|
|
7
7
|
anyStrict<T = any>(value: any, opt?: ToOptAny): T;
|
|
8
8
|
any<T = any>(value: any, opt?: ToOptAny, notNull?: boolean): T;
|
|
9
9
|
booleanStrict(value: any, opt?: ToOptAny): boolean;
|
|
@@ -28,6 +28,10 @@ export interface CommonToLike extends ShiftSecure<CommonToSecure> {
|
|
|
28
28
|
arrayStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
29
29
|
arrayNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
30
30
|
array<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>, notNull?: boolean): Array<V>;
|
|
31
|
+
delimitedStrict<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
32
|
+
delimitedStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
33
|
+
delimitedNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
34
|
+
delimited<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>, notNull?: boolean): Array<V>;
|
|
31
35
|
setStrict<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
32
36
|
setStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
33
37
|
setNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
@@ -47,7 +51,7 @@ export interface CommonToLike extends ShiftSecure<CommonToSecure> {
|
|
|
47
51
|
mapNotEmpty<K = any, V = any>(value: any, opt?: ToOptAny, valueFn?: ToSubKeyFnLambda<V>, keyFn?: ToSubIndexFnLambda<K>): Map<K, V>;
|
|
48
52
|
map<K = any, V = any>(value: any, opt?: ToOptAny, valueFn?: ToSubKeyFnLambda<V>, keyFn?: ToSubIndexFnLambda<K>, notNull?: boolean): Map<K, V>;
|
|
49
53
|
}
|
|
50
|
-
export interface
|
|
54
|
+
export interface ToCommonSecure extends ShiftMain<ToCommonLike>, InitLike {
|
|
51
55
|
$runOpt(opt: ToOptAny): ToOpt;
|
|
52
56
|
$runFn<T = any>(fn: Fnc, value: Fnc, opt?: ToOpt): T;
|
|
53
57
|
$errorOrLog(opt: ToOptAny, extra: ToOpt, e?: Error): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dict, EnumAlt, EnumLiteral, EnumMap, Fnc, KeyValue, Obj } from "../shared";
|
|
3
|
-
import { LeyyoLike } from "../leyyo";
|
|
1
|
+
import type { ToCommonLike, ToCommonSecure, ToOpt, ToOptAny, ToSubIndexFnLambda, ToSubKeyFnLambda } from "./index.types";
|
|
2
|
+
import type { Dict, EnumAlt, EnumLiteral, EnumMap, Fnc, KeyValue, Obj } from "../shared";
|
|
3
|
+
import { type LeyyoLike } from "../leyyo";
|
|
4
4
|
import { List } from "./list";
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class ToCommon implements ToCommonLike, ToCommonSecure {
|
|
6
6
|
private lyy;
|
|
7
7
|
private readonly _EMPTY;
|
|
8
8
|
private readonly _EXPECTED_ANY;
|
|
@@ -16,8 +16,8 @@ export declare class CommonTo implements CommonToLike, CommonToSecure {
|
|
|
16
16
|
private readonly _EXPECTED_FUNCTION;
|
|
17
17
|
constructor(lyy: LeyyoLike);
|
|
18
18
|
$init(): void;
|
|
19
|
-
get $back():
|
|
20
|
-
get $secure():
|
|
19
|
+
get $back(): ToCommonLike;
|
|
20
|
+
get $secure(): ToCommonSecure;
|
|
21
21
|
$runOpt(opt: ToOptAny): ToOpt;
|
|
22
22
|
$runFn<T = any>(fn: Fnc, value: Fnc, opt?: ToOpt): T;
|
|
23
23
|
$errorOrLog(opt: ToOptAny, extra: ToOpt, e?: Error): any;
|
|
@@ -52,6 +52,10 @@ export declare class CommonTo implements CommonToLike, CommonToSecure {
|
|
|
52
52
|
arrayStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
53
53
|
arrayNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
54
54
|
array<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>, notNull?: boolean): Array<V>;
|
|
55
|
+
delimitedStrict<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
56
|
+
delimitedStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
57
|
+
delimitedNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Array<V>;
|
|
58
|
+
delimited<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>, notNull?: boolean): Array<V>;
|
|
55
59
|
setStrict<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
56
60
|
setStrictNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
57
61
|
setNotEmpty<V = any>(value: any, opt?: ToOptAny, itemFn?: ToSubIndexFnLambda<V>): Set<V>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ToCommon = void 0;
|
|
4
4
|
const leyyo_1 = require("../leyyo");
|
|
5
5
|
const internal_1 = require("../internal");
|
|
6
6
|
const primitive_1 = require("./primitive");
|
|
@@ -10,7 +10,7 @@ const weak_true_1 = require("./weak-true");
|
|
|
10
10
|
const weak_false_1 = require("./weak-false");
|
|
11
11
|
const list_1 = require("./list");
|
|
12
12
|
// noinspection JSUnusedGlobalSymbols
|
|
13
|
-
class
|
|
13
|
+
class ToCommon {
|
|
14
14
|
// endregion properties
|
|
15
15
|
constructor(lyy) {
|
|
16
16
|
this.lyy = lyy;
|
|
@@ -38,10 +38,10 @@ class CommonTo {
|
|
|
38
38
|
};
|
|
39
39
|
for (const [name, value] of Object.entries(enumMap)) {
|
|
40
40
|
this.lyy.fqn.register(name, value, 'enum', internal_1.FQN);
|
|
41
|
-
this.lyy.hook.queueForCallback(leyyo_1.
|
|
41
|
+
this.lyy.hook.queueForCallback(leyyo_1.LeyyoHookCommon.enumPendingRegister, value);
|
|
42
42
|
}
|
|
43
43
|
}).$lazyRun(() => {
|
|
44
|
-
this.lyy.fqn.register(null,
|
|
44
|
+
this.lyy.fqn.register(null, ToCommon, 'class', internal_1.FQN);
|
|
45
45
|
this.lyy.fqn.register(null, list_1.List, 'class', internal_1.FQN);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -671,6 +671,44 @@ class CommonTo {
|
|
|
671
671
|
}
|
|
672
672
|
return this.$unexpectedError(value, this._EXPECTED_ARRAY, opt);
|
|
673
673
|
}
|
|
674
|
+
delimitedStrict(value, opt, itemFn) {
|
|
675
|
+
return this.delimited(value, opt, itemFn, true);
|
|
676
|
+
}
|
|
677
|
+
delimitedStrictNotEmpty(value, opt, itemFn) {
|
|
678
|
+
const result = this.delimited(value, opt, itemFn, true);
|
|
679
|
+
if (result.length < 1) {
|
|
680
|
+
this.$emptyError('array', opt);
|
|
681
|
+
}
|
|
682
|
+
return result;
|
|
683
|
+
}
|
|
684
|
+
delimitedNotEmpty(value, opt, itemFn) {
|
|
685
|
+
const result = this.delimited(value, opt, itemFn, false);
|
|
686
|
+
if (result && result.length < 1) {
|
|
687
|
+
this.$emptyError('array', opt);
|
|
688
|
+
}
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
delimited(value, opt, itemFn, notNull) {
|
|
692
|
+
if (this._EMPTY.includes(value)) {
|
|
693
|
+
if (notNull) {
|
|
694
|
+
this.$nullError(this._EXPECTED_ARRAY, opt);
|
|
695
|
+
}
|
|
696
|
+
return value;
|
|
697
|
+
}
|
|
698
|
+
switch (typeof value) {
|
|
699
|
+
case "string":
|
|
700
|
+
return this.array(value.split(',').map(v => v.trim()), opt, itemFn, notNull);
|
|
701
|
+
case "boolean":
|
|
702
|
+
case "number":
|
|
703
|
+
case "bigint":
|
|
704
|
+
return this.array([value], opt, itemFn, notNull);
|
|
705
|
+
case 'object':
|
|
706
|
+
return this.array(value, opt, itemFn, notNull);
|
|
707
|
+
case 'function':
|
|
708
|
+
return this.$runFn(v => this.delimited(v, opt, itemFn, notNull), value, opt);
|
|
709
|
+
}
|
|
710
|
+
return this.$unexpectedError(value, this._EXPECTED_ARRAY, opt);
|
|
711
|
+
}
|
|
674
712
|
setStrict(value, opt, itemFn) {
|
|
675
713
|
return this.set(value, opt, itemFn, true);
|
|
676
714
|
}
|
|
@@ -1037,5 +1075,5 @@ class CommonTo {
|
|
|
1037
1075
|
return this.$unexpectedError(value, this._EXPECTED_OBJECT, opt);
|
|
1038
1076
|
}
|
|
1039
1077
|
}
|
|
1040
|
-
exports.
|
|
1041
|
-
//# sourceMappingURL=
|
|
1078
|
+
exports.ToCommon = ToCommon;
|
|
1079
|
+
//# sourceMappingURL=to.common.js.map
|