@leyyo/common 1.0.4 → 1.0.6
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 +54 -0
- package/dist/assertion/common-assertion.js +180 -0
- package/dist/assertion/common-assertion.js.map +1 -0
- package/dist/assertion/index-types.d.ts +154 -159
- package/dist/assertion/index-types.js +1 -0
- package/dist/assertion/index-types.js.map +1 -0
- package/dist/assertion/index.d.ts +0 -1
- package/dist/assertion/index.js +1 -1
- package/dist/assertion/index.js.map +1 -0
- package/dist/descriptor/common-descriptor.d.ts +19 -0
- package/dist/descriptor/common-descriptor.js +92 -0
- package/dist/descriptor/common-descriptor.js.map +1 -0
- package/dist/descriptor/index-types.d.ts +21 -0
- package/dist/{literal → descriptor}/index-types.js +1 -0
- package/dist/descriptor/index-types.js.map +1 -0
- package/dist/descriptor/index.d.ts +1 -0
- package/dist/{storage → descriptor}/index.js +1 -1
- package/dist/descriptor/index.js.map +1 -0
- package/dist/developer/common-developer.d.ts +29 -0
- package/dist/developer/common-developer.js +266 -0
- package/dist/developer/common-developer.js.map +1 -0
- package/dist/developer/index-types.d.ts +77 -0
- package/dist/{storage → developer}/index-types.js +1 -0
- package/dist/developer/index-types.js.map +1 -0
- package/dist/developer/index.d.ts +1 -0
- package/dist/developer/index.js +18 -0
- package/dist/developer/index.js.map +1 -0
- package/dist/error/{common-error-impl.d.ts → common-error.d.ts} +5 -5
- package/dist/error/common-error.js +104 -0
- package/dist/error/common-error.js.map +1 -0
- package/dist/error/index-types.d.ts +21 -2
- package/dist/error/index-types.js +1 -0
- package/dist/error/index-types.js.map +1 -0
- package/dist/error/index.d.ts +0 -1
- package/dist/error/index.js +1 -1
- package/dist/error/index.js.map +1 -0
- package/dist/exception/assertion-exception.d.ts +2 -2
- package/dist/exception/assertion-exception.js +3 -2
- package/dist/exception/assertion-exception.js.map +1 -0
- package/dist/exception/caused-exception.d.ts +2 -2
- package/dist/exception/caused-exception.js +3 -2
- package/dist/exception/caused-exception.js.map +1 -0
- package/dist/exception/developer-exception.d.ts +2 -2
- package/dist/exception/developer-exception.js +3 -2
- package/dist/exception/developer-exception.js.map +1 -0
- package/dist/exception/exception.d.ts +7 -5
- package/dist/exception/exception.js +14 -4
- package/dist/exception/exception.js.map +1 -0
- package/dist/exception/index-types.d.ts +1 -1
- package/dist/exception/index-types.js +1 -0
- package/dist/exception/index-types.js.map +1 -0
- package/dist/exception/index.d.ts +1 -0
- package/dist/exception/index.js +2 -0
- package/dist/exception/index.js.map +1 -0
- package/dist/exception/invalid-value-exception.d.ts +5 -0
- package/dist/exception/invalid-value-exception.js +12 -0
- package/dist/exception/invalid-value-exception.js.map +1 -0
- package/dist/exception/multiple-exception.js +1 -0
- package/dist/exception/multiple-exception.js.map +1 -0
- package/dist/fqn/common-fqn.d.ts +20 -0
- package/dist/fqn/common-fqn.js +116 -0
- package/dist/fqn/common-fqn.js.map +1 -0
- package/dist/fqn/index-types.d.ts +14 -5
- package/dist/fqn/index-types.js +1 -0
- package/dist/fqn/index-types.js.map +1 -0
- package/dist/fqn/index.d.ts +0 -1
- package/dist/fqn/index.js +1 -1
- package/dist/fqn/index.js.map +1 -0
- package/dist/hook/{common-hook-impl.d.ts → common-hook.d.ts} +12 -10
- package/dist/hook/{common-hook-impl.js → common-hook.js} +27 -21
- package/dist/hook/common-hook.js.map +1 -0
- package/dist/hook/index-types.d.ts +29 -14
- package/dist/hook/index-types.js +1 -0
- package/dist/hook/index-types.js.map +1 -0
- package/dist/hook/index.d.ts +0 -1
- package/dist/hook/index.js +1 -1
- package/dist/hook/index.js.map +1 -0
- package/dist/index.d.ts +27 -11
- package/dist/index.js +30 -20
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +4 -1
- package/dist/internal.js.map +1 -0
- package/dist/is/{common-is-impl.d.ts → common-is.d.ts} +19 -5
- package/dist/is/common-is.js +136 -0
- package/dist/is/common-is.js.map +1 -0
- package/dist/is/index-types.d.ts +48 -3
- package/dist/is/index-types.js +1 -0
- package/dist/is/index-types.js.map +1 -0
- package/dist/is/index.d.ts +0 -1
- package/dist/is/index.js +1 -1
- package/dist/is/index.js.map +1 -0
- package/dist/leyyo/index-types.d.ts +30 -17
- package/dist/leyyo/index-types.js +1 -0
- package/dist/leyyo/index-types.js.map +1 -0
- package/dist/leyyo/index.d.ts +1 -1
- package/dist/leyyo/index.js +2 -1
- package/dist/leyyo/index.js.map +1 -0
- package/dist/leyyo/leyyo-common-hook.d.ts +10 -0
- package/dist/leyyo/leyyo-common-hook.js +18 -0
- package/dist/leyyo/leyyo-common-hook.js.map +1 -0
- package/dist/leyyo/leyyo.d.ts +35 -0
- package/dist/leyyo/leyyo.js +77 -0
- package/dist/leyyo/leyyo.js.map +1 -0
- package/dist/log/common-log.d.ts +14 -0
- package/dist/log/common-log.js +92 -0
- package/dist/log/common-log.js.map +1 -0
- package/dist/log/index-types.d.ts +57 -3
- package/dist/log/index-types.js +1 -0
- package/dist/log/index-types.js.map +1 -0
- package/dist/log/index.d.ts +2 -2
- package/dist/log/index.js +3 -2
- package/dist/log/index.js.map +1 -0
- package/dist/log/logger-instance.d.ts +31 -0
- package/dist/log/logger-instance.js +114 -0
- package/dist/log/logger-instance.js.map +1 -0
- package/dist/{literal → log}/severity.js +1 -0
- package/dist/log/severity.js.map +1 -0
- package/dist/repo/common-repo.d.ts +44 -0
- package/dist/repo/common-repo.js +180 -0
- package/dist/repo/common-repo.js.map +1 -0
- package/dist/repo/index-types.d.ts +104 -0
- package/dist/{shared/index-aliases.js → repo/index-types.js} +1 -2
- package/dist/repo/index-types.js.map +1 -0
- package/dist/repo/index.d.ts +2 -0
- package/dist/repo/index.js +19 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/repo-type.d.ts +8 -0
- package/dist/repo/repo-type.js +8 -0
- package/dist/repo/repo-type.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +5 -0
- package/dist/server.js.map +1 -0
- package/dist/shared/index-types.d.ts +162 -132
- package/dist/shared/index-types.js +2 -1
- package/dist/shared/index-types.js.map +1 -0
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/index.js +1 -4
- package/dist/shared/index.js.map +1 -0
- package/dist/system/common-system.d.ts +10 -0
- package/dist/system/common-system.js +65 -0
- package/dist/system/common-system.js.map +1 -0
- package/dist/{literal → system}/country-code.js +1 -0
- package/dist/system/country-code.js.map +1 -0
- package/dist/{literal → system}/environment.js +1 -0
- package/dist/system/environment.js.map +1 -0
- package/dist/{literal → system}/http-method.js +1 -0
- package/dist/system/http-method.js.map +1 -0
- package/dist/{literal → system}/http-place.js +1 -0
- package/dist/system/http-place.js.map +1 -0
- package/dist/system/index-types.d.ts +6 -0
- package/dist/system/index-types.js +3 -0
- package/dist/system/index-types.js.map +1 -0
- package/dist/{literal → system}/index.d.ts +1 -8
- package/dist/{literal → system}/index.js +2 -8
- package/dist/system/index.js.map +1 -0
- package/dist/{literal → system}/language-code.js +1 -0
- package/dist/system/language-code.js.map +1 -0
- package/dist/{literal → system}/locale-code.js +1 -0
- package/dist/system/locale-code.js.map +1 -0
- package/dist/{literal → system}/sys-class.js +1 -0
- package/dist/system/sys-class.js.map +1 -0
- package/dist/{literal → system}/sys-function.js +1 -0
- package/dist/system/sys-function.js.map +1 -0
- package/dist/to/common-to.d.ts +45 -0
- package/dist/to/common-to.js +868 -0
- package/dist/to/common-to.js.map +1 -0
- package/dist/to/index-types.d.ts +38 -18
- package/dist/to/index-types.js +1 -0
- package/dist/to/index-types.js.map +1 -0
- package/dist/to/index.d.ts +6 -1
- package/dist/to/index.js +7 -1
- package/dist/to/index.js.map +1 -0
- package/dist/{literal → to}/key-value.js +1 -0
- package/dist/to/key-value.js.map +1 -0
- package/dist/{shared → to}/list.d.ts +1 -0
- package/dist/{shared → to}/list.js +4 -0
- package/dist/to/list.js.map +1 -0
- package/dist/{literal → to}/primitive.js +1 -0
- package/dist/to/primitive.js.map +1 -0
- package/dist/{literal → to}/real-value.js +1 -0
- package/dist/to/real-value.js.map +1 -0
- package/dist/{literal → to}/weak-false.js +1 -0
- package/dist/to/weak-false.js.map +1 -0
- package/dist/{literal → to}/weak-true.js +1 -0
- package/dist/to/weak-true.js.map +1 -0
- package/dist/wrapper/common-wrapper.d.ts +26 -0
- package/dist/wrapper/common-wrapper.js +81 -0
- package/dist/wrapper/common-wrapper.js.map +1 -0
- package/dist/wrapper/index-types.d.ts +29 -0
- package/dist/wrapper/index-types.js +3 -0
- package/dist/wrapper/index-types.js.map +1 -0
- package/dist/wrapper/index.d.ts +2 -0
- package/dist/wrapper/index.js +19 -0
- package/dist/wrapper/index.js.map +1 -0
- package/dist/wrapper/wrap.d.ts +7 -0
- package/dist/wrapper/wrap.js +11 -0
- package/dist/wrapper/wrap.js.map +1 -0
- package/package.json +13 -15
- package/dist/assertion/common-assertion-impl.d.ts +0 -65
- package/dist/assertion/common-assertion-impl.js +0 -248
- package/dist/error/common-error-impl.js +0 -92
- package/dist/fqn/common-fqn-impl.d.ts +0 -18
- package/dist/fqn/common-fqn-impl.js +0 -121
- package/dist/is/common-is-impl.js +0 -91
- package/dist/leyyo/leyyo-impl.d.ts +0 -26
- package/dist/leyyo/leyyo-impl.js +0 -94
- package/dist/literal/index-types.d.ts +0 -6
- package/dist/literal/storage-type.d.ts +0 -8
- package/dist/literal/storage-type.js +0 -7
- package/dist/log/common-log-impl.d.ts +0 -14
- package/dist/log/common-log-impl.js +0 -59
- package/dist/log/logger-impl.d.ts +0 -23
- package/dist/log/logger-impl.js +0 -77
- package/dist/shared/assert.d.ts +0 -6
- package/dist/shared/assert.js +0 -14
- package/dist/shared/index-aliases.d.ts +0 -167
- package/dist/shared/index-constants.d.ts +0 -8
- package/dist/shared/index-constants.js +0 -11
- package/dist/storage/common-storage-impl.d.ts +0 -47
- package/dist/storage/common-storage-impl.js +0 -150
- package/dist/storage/index-types.d.ts +0 -87
- package/dist/storage/index.d.ts +0 -2
- package/dist/to/common-to-impl.d.ts +0 -38
- package/dist/to/common-to-impl.js +0 -553
- /package/dist/{literal → log}/severity.d.ts +0 -0
- /package/dist/{literal → system}/country-code.d.ts +0 -0
- /package/dist/{literal → system}/environment.d.ts +0 -0
- /package/dist/{literal → system}/http-method.d.ts +0 -0
- /package/dist/{literal → system}/http-place.d.ts +0 -0
- /package/dist/{literal → system}/language-code.d.ts +0 -0
- /package/dist/{literal → system}/locale-code.d.ts +0 -0
- /package/dist/{literal → system}/sys-class.d.ts +0 -0
- /package/dist/{literal → system}/sys-function.d.ts +0 -0
- /package/dist/{literal → to}/key-value.d.ts +0 -0
- /package/dist/{literal → to}/primitive.d.ts +0 -0
- /package/dist/{literal → to}/real-value.d.ts +0 -0
- /package/dist/{literal → to}/weak-false.d.ts +0 -0
- /package/dist/{literal → to}/weak-true.d.ts +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoggerInstance = void 0;
|
|
4
|
+
const index_1 = require("../index");
|
|
5
|
+
// noinspection JSUnusedLocalSymbols
|
|
6
|
+
class LoggerInstance {
|
|
7
|
+
constructor(value) {
|
|
8
|
+
switch (typeof value) {
|
|
9
|
+
case "function":
|
|
10
|
+
this._clazz = value;
|
|
11
|
+
this._name = LoggerInstance._fqn.name(value);
|
|
12
|
+
break;
|
|
13
|
+
case "object":
|
|
14
|
+
this._clazz = value.constructor;
|
|
15
|
+
this._name = LoggerInstance._fqn.name(value);
|
|
16
|
+
break;
|
|
17
|
+
case "string":
|
|
18
|
+
this._name = value;
|
|
19
|
+
break;
|
|
20
|
+
default:
|
|
21
|
+
LoggerInstance._dev.invalid({
|
|
22
|
+
issue: 'invalid.logger.name',
|
|
23
|
+
where: 'leyyo.common.LoggerInstance',
|
|
24
|
+
type: typeof value
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// when this object is signed by FQN, then refresh logger name
|
|
28
|
+
if (!LoggerInstance._fqn.exists(value)) {
|
|
29
|
+
LoggerInstance._fqn.addHook(value, (name) => {
|
|
30
|
+
this._name = name;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
_prepare(severity, info, params) {
|
|
35
|
+
const extra = { where: this._name };
|
|
36
|
+
let e;
|
|
37
|
+
if (info instanceof Error) {
|
|
38
|
+
e = info;
|
|
39
|
+
}
|
|
40
|
+
else if (typeof info === 'string') {
|
|
41
|
+
extra['message'] = info;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
extra['info'] = info;
|
|
45
|
+
}
|
|
46
|
+
const { message, opt } = index_1.$dev.buildParameters(params, extra, e);
|
|
47
|
+
return { severity, message, params: opt };
|
|
48
|
+
}
|
|
49
|
+
debug(message, params) {
|
|
50
|
+
LoggerInstance._log.apply(this._prepare('debug', message, params));
|
|
51
|
+
}
|
|
52
|
+
error(message, params) {
|
|
53
|
+
LoggerInstance._log.apply(this._prepare('error', message, params));
|
|
54
|
+
}
|
|
55
|
+
info(message, params) {
|
|
56
|
+
LoggerInstance._log.apply(this._prepare('info', message, params));
|
|
57
|
+
}
|
|
58
|
+
log(message, params) {
|
|
59
|
+
LoggerInstance._log.apply(this._prepare('log', message, params));
|
|
60
|
+
}
|
|
61
|
+
trace(message, params) {
|
|
62
|
+
LoggerInstance._log.apply(this._prepare('trace', message, params));
|
|
63
|
+
}
|
|
64
|
+
warn(message, params) {
|
|
65
|
+
LoggerInstance._log.apply(this._prepare('warn', message, params));
|
|
66
|
+
}
|
|
67
|
+
// region secure
|
|
68
|
+
get $back() {
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
get $secure() {
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
get $clazz() {
|
|
75
|
+
return this._clazz;
|
|
76
|
+
}
|
|
77
|
+
get $name() {
|
|
78
|
+
return this._name;
|
|
79
|
+
}
|
|
80
|
+
static $setLeyyo(leyyo) {
|
|
81
|
+
this._fqn = leyyo.fqn;
|
|
82
|
+
this._log = leyyo.log;
|
|
83
|
+
this._dev = leyyo.dev;
|
|
84
|
+
}
|
|
85
|
+
$setMethod(method, lambda) {
|
|
86
|
+
if (typeof lambda === 'function') {
|
|
87
|
+
this[method] = lambda;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this[method] = () => {
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
debug$(opt) {
|
|
95
|
+
this.debug(undefined, opt);
|
|
96
|
+
}
|
|
97
|
+
error$(opt) {
|
|
98
|
+
this.error(undefined, opt);
|
|
99
|
+
}
|
|
100
|
+
info$(opt) {
|
|
101
|
+
this.info(undefined, opt);
|
|
102
|
+
}
|
|
103
|
+
log$(opt) {
|
|
104
|
+
this.log(undefined, opt);
|
|
105
|
+
}
|
|
106
|
+
trace$(opt) {
|
|
107
|
+
this.trace(undefined, opt);
|
|
108
|
+
}
|
|
109
|
+
warn$(opt) {
|
|
110
|
+
this.warn(undefined, opt);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.LoggerInstance = LoggerInstance;
|
|
114
|
+
//# sourceMappingURL=logger-instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger-instance.js","sourceRoot":"","sources":["../../src/log/logger-instance.ts"],"names":[],"mappings":";;;AAIA,oCAA+C;AAE/C,oCAAoC;AACpC,MAAa,cAAc;IAQvB,YAAY,KAAiC;QACzC,QAAQ,OAAO,KAAK,EAAE,CAAC;YACnB,KAAK,UAAU;gBACX,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;gBACpB,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC7C,MAAM;YACV,KAAK,QAAQ;gBACT,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;gBAChC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CA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|
1
|
+
import { CommonRepoLike, CommonRepoSecure, CommonRepoDetail, CommonRepoItem } from "./index-types";
|
|
2
|
+
import { LeyyoLike } from "../leyyo";
|
|
3
|
+
import { RepoType } from "./repo-type";
|
|
4
|
+
import { List } from "../to";
|
|
5
|
+
/** @inheritDoc */
|
|
6
|
+
export declare class CommonRepo implements CommonRepoLike, CommonRepoSecure {
|
|
7
|
+
private readonly _lists;
|
|
8
|
+
private readonly _arrays;
|
|
9
|
+
private readonly _maps;
|
|
10
|
+
private readonly _sets;
|
|
11
|
+
private assertion;
|
|
12
|
+
private dev;
|
|
13
|
+
/**
|
|
14
|
+
* Default constructor
|
|
15
|
+
*
|
|
16
|
+
* Responsibilities
|
|
17
|
+
* - Create repositories => ie: lists, arrays, maps, sets
|
|
18
|
+
* */
|
|
19
|
+
constructor();
|
|
20
|
+
$init(leyyo: LeyyoLike): void;
|
|
21
|
+
private _appendDetail;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
newList<V>(collection: symbol): List<V>;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
getList<V>(collection: symbol): List<V>;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
newArray<V>(collection: symbol): Array<V>;
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
getArray<V>(collection: symbol): Array<V>;
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
newMap<K, V>(collection: symbol): Map<K, V>;
|
|
32
|
+
/** @inheritDoc */
|
|
33
|
+
getMap<K, V>(collection: symbol): Map<K, V>;
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
newSet<V>(collection: symbol): Set<V>;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
getSet<V>(collection: symbol): Set<V>;
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
detailItem(type: RepoType, collection?: symbol): CommonRepoItem;
|
|
40
|
+
/** @inheritDoc */
|
|
41
|
+
details(type?: RepoType, collection?: symbol): CommonRepoDetail;
|
|
42
|
+
get $back(): CommonRepoLike;
|
|
43
|
+
get $secure(): CommonRepoSecure;
|
|
44
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommonRepo = void 0;
|
|
4
|
+
const leyyo_1 = require("../leyyo");
|
|
5
|
+
const internal_1 = require("../internal");
|
|
6
|
+
const repo_type_1 = require("./repo-type");
|
|
7
|
+
const to_1 = require("../to");
|
|
8
|
+
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols
|
|
9
|
+
/** @inheritDoc */
|
|
10
|
+
class CommonRepo {
|
|
11
|
+
/**
|
|
12
|
+
* Default constructor
|
|
13
|
+
*
|
|
14
|
+
* Responsibilities
|
|
15
|
+
* - Create repositories => ie: lists, arrays, maps, sets
|
|
16
|
+
* */
|
|
17
|
+
constructor() {
|
|
18
|
+
this._lists = new Map();
|
|
19
|
+
this._arrays = new Map();
|
|
20
|
+
this._maps = new Map();
|
|
21
|
+
this._sets = new Map();
|
|
22
|
+
}
|
|
23
|
+
$init(leyyo) {
|
|
24
|
+
this.assertion = leyyo.assertion;
|
|
25
|
+
this.dev = leyyo.dev;
|
|
26
|
+
leyyo.$secure.$lazyRun(() => {
|
|
27
|
+
leyyo.fqn.register(null, CommonRepo, 'class', internal_1.FQN_PCK);
|
|
28
|
+
}).$lazyRun(() => {
|
|
29
|
+
const enumMap = {
|
|
30
|
+
RepoType: repo_type_1.RepoTypeItems,
|
|
31
|
+
};
|
|
32
|
+
for (const [name, value] of Object.entries(enumMap)) {
|
|
33
|
+
leyyo.fqn.register(name, value, 'enum', internal_1.FQN_PCK);
|
|
34
|
+
leyyo.hook.queueForCallback(leyyo_1.LeyyoCommonHook.enumPendingRegister, value);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
_appendDetail(result, collection, size, duplicated) {
|
|
39
|
+
if (result[collection.description] === undefined) {
|
|
40
|
+
result[collection.description] = size;
|
|
41
|
+
return duplicated;
|
|
42
|
+
}
|
|
43
|
+
duplicated++;
|
|
44
|
+
result[collection.description + '##' + duplicated] = size;
|
|
45
|
+
return duplicated;
|
|
46
|
+
}
|
|
47
|
+
// region list
|
|
48
|
+
/** @inheritDoc */
|
|
49
|
+
newList(collection) {
|
|
50
|
+
this.assertion.sym(collection, () => this.dev.opt({ where: 'leyyo.common.CommonRepo', method: 'newList' }));
|
|
51
|
+
const list = new to_1.List();
|
|
52
|
+
this._lists.set(collection, list);
|
|
53
|
+
return list;
|
|
54
|
+
}
|
|
55
|
+
/** @inheritDoc */
|
|
56
|
+
getList(collection) {
|
|
57
|
+
return this._lists.get(collection);
|
|
58
|
+
}
|
|
59
|
+
// endregion list
|
|
60
|
+
// region array
|
|
61
|
+
/** @inheritDoc */
|
|
62
|
+
newArray(collection) {
|
|
63
|
+
this.assertion.sym(collection, () => this.dev.opt({ where: 'leyyo.common.CommonRepo', method: 'newArray' }));
|
|
64
|
+
const arr = [];
|
|
65
|
+
this._arrays.set(collection, arr);
|
|
66
|
+
return arr;
|
|
67
|
+
}
|
|
68
|
+
/** @inheritDoc */
|
|
69
|
+
getArray(collection) {
|
|
70
|
+
return this._arrays.get(collection);
|
|
71
|
+
}
|
|
72
|
+
// endregion array
|
|
73
|
+
// region map
|
|
74
|
+
/** @inheritDoc */
|
|
75
|
+
newMap(collection) {
|
|
76
|
+
this.assertion.sym(collection, () => this.dev.opt({ where: 'leyyo.common.CommonRepo', method: 'newMap' }));
|
|
77
|
+
const map = new Map;
|
|
78
|
+
this._maps.set(collection, map);
|
|
79
|
+
return map;
|
|
80
|
+
}
|
|
81
|
+
/** @inheritDoc */
|
|
82
|
+
getMap(collection) {
|
|
83
|
+
return this._maps.get(collection);
|
|
84
|
+
}
|
|
85
|
+
// endregion map
|
|
86
|
+
// region set
|
|
87
|
+
/** @inheritDoc */
|
|
88
|
+
newSet(collection) {
|
|
89
|
+
this.assertion.sym(collection, () => this.dev.opt({ where: 'leyyo.common.CommonRepo', method: 'newSet' }));
|
|
90
|
+
const set = new Set;
|
|
91
|
+
this._sets.set(collection, set);
|
|
92
|
+
return set;
|
|
93
|
+
}
|
|
94
|
+
/** @inheritDoc */
|
|
95
|
+
getSet(collection) {
|
|
96
|
+
return this._sets.get(collection);
|
|
97
|
+
}
|
|
98
|
+
// endregion set
|
|
99
|
+
// region detail
|
|
100
|
+
/** @inheritDoc */
|
|
101
|
+
detailItem(type, collection) {
|
|
102
|
+
const result = {};
|
|
103
|
+
let duplicated = 0;
|
|
104
|
+
switch (type) {
|
|
105
|
+
case "array":
|
|
106
|
+
if (collection) {
|
|
107
|
+
if (this._arrays.has(collection)) {
|
|
108
|
+
return { [collection.description]: this._arrays.get(collection).length };
|
|
109
|
+
}
|
|
110
|
+
return { [collection.description]: -1 };
|
|
111
|
+
}
|
|
112
|
+
for (const [key, list] of this._arrays.entries()) {
|
|
113
|
+
duplicated = this._appendDetail(result, key, list.length, duplicated);
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
case "list":
|
|
117
|
+
if (collection) {
|
|
118
|
+
if (this._lists.has(collection)) {
|
|
119
|
+
return { [collection.description]: this._lists.get(collection).length };
|
|
120
|
+
}
|
|
121
|
+
return { [collection.description]: -1 };
|
|
122
|
+
}
|
|
123
|
+
for (const [key, list] of this._lists.entries()) {
|
|
124
|
+
duplicated = this._appendDetail(result, key, list.length, duplicated);
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
case "map":
|
|
128
|
+
if (collection) {
|
|
129
|
+
if (this._maps.has(collection)) {
|
|
130
|
+
return { [collection.description]: this._maps.get(collection).size };
|
|
131
|
+
}
|
|
132
|
+
return { [collection.description]: -1 };
|
|
133
|
+
}
|
|
134
|
+
for (const [key, map] of this._maps.entries()) {
|
|
135
|
+
duplicated = this._appendDetail(result, key, map.size, duplicated);
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
case "set":
|
|
139
|
+
if (collection) {
|
|
140
|
+
if (this._sets.has(collection)) {
|
|
141
|
+
return { [collection.description]: this._sets.get(collection).size };
|
|
142
|
+
}
|
|
143
|
+
return { [collection.description]: -1 };
|
|
144
|
+
}
|
|
145
|
+
for (const [key, set] of this._sets.entries()) {
|
|
146
|
+
duplicated = this._appendDetail(result, key, set.size, duplicated);
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
default:
|
|
150
|
+
if (collection) {
|
|
151
|
+
return { [collection.description]: -1 };
|
|
152
|
+
}
|
|
153
|
+
return { ['*']: -1 };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** @inheritDoc */
|
|
157
|
+
details(type, collection) {
|
|
158
|
+
const result = {};
|
|
159
|
+
if (type) {
|
|
160
|
+
result[type] = this.detailItem(type, collection);
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
result['array'] = this.detailItem('array', collection);
|
|
165
|
+
result['list'] = this.detailItem('list', collection);
|
|
166
|
+
result['map'] = this.detailItem('map', collection);
|
|
167
|
+
result['set'] = this.detailItem('set', collection);
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// endregion detail
|
|
172
|
+
get $back() {
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
get $secure() {
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.CommonRepo = CommonRepo;
|
|
180
|
+
//# sourceMappingURL=common-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-repo.js","sourceRoot":"","sources":["../../src/repo/common-repo.ts"],"names":[],"mappings":";;;AACA,oCAAoD;AAGpD,0CAAoC;AACpC,2CAAoD;AACpD,8BAA2B;AAE3B,0DAA0D;AAC1D,kBAAkB;AAClB,MAAa,UAAU;IAQnB;;;;;SAKK;IACL;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;QAC3C,IAAI,C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C,CAAC;IACL,CAAC;IAED,kBAAkB;IAClB,OAAO,CAAC,IAAe,EAAE,UAAmB;QACxC,MAAM,MAAM,GAAG,EAAsB,CAAC;QACtC,IAAI,IAAI,EAAE,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACjD,OAAO,MAAM,CAAC;QAClB,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACvD,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACrD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YACnD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YACnD,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;IACD,mBAAmB;IAEnB,IAAI,KAAK;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAlMD,gCAkMC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Dict, InitLike, ShiftMain, ShiftSecure } from "../shared";
|
|
2
|
+
import { RepoType } from "./repo-type";
|
|
3
|
+
import { List } from "../to";
|
|
4
|
+
/**
|
|
5
|
+
* Common Repository factory
|
|
6
|
+
*
|
|
7
|
+
* Purpose, unify all iteration based data in some place to track memory usage in your applications
|
|
8
|
+
* */
|
|
9
|
+
export interface CommonRepoLike extends ShiftSecure<CommonRepoSecure> {
|
|
10
|
+
/**
|
|
11
|
+
* Creates new array with given collection
|
|
12
|
+
*
|
|
13
|
+
* @param {symbol} collection
|
|
14
|
+
* @return {Array<any>}
|
|
15
|
+
* */
|
|
16
|
+
newArray<V>(collection: symbol): Array<V>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns an array by given collection
|
|
19
|
+
*
|
|
20
|
+
* @param {symbol} collection
|
|
21
|
+
* @return {Array<any>}
|
|
22
|
+
*
|
|
23
|
+
* Note:
|
|
24
|
+
* If the array does not exist than it returns null
|
|
25
|
+
* */
|
|
26
|
+
getArray<V>(collection: symbol): Array<V>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates new list with given collection
|
|
29
|
+
*
|
|
30
|
+
* @param {symbol} collection
|
|
31
|
+
* @return {List<any>}
|
|
32
|
+
* */
|
|
33
|
+
newList<V>(collection: symbol): List<V>;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a list by given collection
|
|
36
|
+
*
|
|
37
|
+
* @param {symbol} collection
|
|
38
|
+
* @return {List<any>}
|
|
39
|
+
*
|
|
40
|
+
* Note:
|
|
41
|
+
* If the list does not exist than it returns null
|
|
42
|
+
* */
|
|
43
|
+
getList<V>(collection: symbol): List<V>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates new map with given collection
|
|
46
|
+
*
|
|
47
|
+
* @param {symbol} collection
|
|
48
|
+
* @return {Map<any, any>}
|
|
49
|
+
* */
|
|
50
|
+
newMap<K, V>(collection: symbol): Map<K, V>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a map by given collection
|
|
53
|
+
*
|
|
54
|
+
* @param {symbol} collection
|
|
55
|
+
* @return {Map<any, any>}
|
|
56
|
+
*
|
|
57
|
+
* Note:
|
|
58
|
+
* If the map does not exist than it returns null
|
|
59
|
+
* */
|
|
60
|
+
getMap<K, V>(collection: symbol): Map<K, V>;
|
|
61
|
+
/**
|
|
62
|
+
* Creates new set with given collection
|
|
63
|
+
*
|
|
64
|
+
* @param {symbol} collection
|
|
65
|
+
* @return {Set<any>}
|
|
66
|
+
* */
|
|
67
|
+
newSet<V>(collection: symbol): Set<V>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns a set by given collection
|
|
70
|
+
*
|
|
71
|
+
* @param {symbol} collection
|
|
72
|
+
* @return {Set<any>}
|
|
73
|
+
*
|
|
74
|
+
* Note:
|
|
75
|
+
* If the set does not exist than it returns null
|
|
76
|
+
* */
|
|
77
|
+
getSet<V>(collection: symbol): Set<V>;
|
|
78
|
+
/**
|
|
79
|
+
* Get sizes of each repository by given type and collection (optional)
|
|
80
|
+
*
|
|
81
|
+
* @param {RepoType} type
|
|
82
|
+
* @param {symbol?} collection
|
|
83
|
+
* @return {CommonRepoItem}
|
|
84
|
+
* */
|
|
85
|
+
detailItem(type: RepoType, collection?: symbol): CommonRepoItem;
|
|
86
|
+
/**
|
|
87
|
+
* Exports sizes of repositories by given type and collection
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* @param {RepoType?} type
|
|
91
|
+
* @param {symbol?} collection
|
|
92
|
+
* @return {CommonRepoDetail}
|
|
93
|
+
* */
|
|
94
|
+
details(type?: RepoType, collection?: symbol): CommonRepoDetail;
|
|
95
|
+
}
|
|
96
|
+
export type CommonRepoSecure = ShiftMain<CommonRepoLike> & InitLike;
|
|
97
|
+
/**
|
|
98
|
+
* Repo size dictionary which in corresponding type
|
|
99
|
+
* */
|
|
100
|
+
export type CommonRepoItem = Dict<number>;
|
|
101
|
+
/**
|
|
102
|
+
* Repo export dictionary which includes items
|
|
103
|
+
* */
|
|
104
|
+
export type CommonRepoDetail = Record<RepoType, CommonRepoItem>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/repo/index-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./index-types"), exports);
|
|
18
|
+
__exportStar(require("./repo-type"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-type.js","sourceRoot":"","sources":["../../src/repo/repo-type.ts"],"names":[],"mappings":";;;AAAA;;KAEK;AACQ,QAAA,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAAA,mCAA8B;AAE9B,aAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC"}
|