@leyyo/common 1.3.5 → 1.3.7
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/base/index.d.ts +3 -0
- package/dist/base/index.js +20 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/index.types.d.ts +196 -0
- package/dist/{type/index.js → base/index.types.js} +2 -3
- package/dist/base/index.types.js.map +1 -0
- package/dist/base/leyyo.d.ts +5 -0
- package/dist/base/leyyo.js +85 -0
- package/dist/base/leyyo.js.map +1 -0
- package/dist/base/leyyo.types.d.ts +18 -0
- package/dist/base/leyyo.types.js +3 -0
- package/dist/base/leyyo.types.js.map +1 -0
- package/dist/class/index.d.ts +1 -1
- package/dist/class/index.js +1 -1
- package/dist/class/index.js.map +1 -1
- package/dist/class/index.types.d.ts +30 -0
- package/dist/class/index.types.js +3 -0
- package/dist/class/index.types.js.map +1 -0
- package/dist/class/list.d.ts +1 -1
- package/dist/class/logger.instance.d.ts +14 -10
- package/dist/class/logger.instance.js +34 -72
- package/dist/class/logger.instance.js.map +1 -1
- package/dist/common/deploy.common.d.ts +26 -0
- package/dist/common/deploy.common.js +74 -0
- package/dist/common/deploy.common.js.map +1 -0
- package/dist/common/enum.pool.d.ts +23 -0
- package/dist/common/enum.pool.js +100 -0
- package/dist/common/enum.pool.js.map +1 -0
- package/dist/common/error.common.d.ts +48 -0
- package/dist/common/error.common.js +328 -0
- package/dist/common/error.common.js.map +1 -0
- package/dist/common/error.pool.d.ts +20 -0
- package/dist/common/error.pool.js +54 -0
- package/dist/common/error.pool.js.map +1 -0
- package/dist/common/event.common.d.ts +24 -0
- package/dist/common/event.common.js +135 -0
- package/dist/common/event.common.js.map +1 -0
- package/dist/common/index.d.ts +11 -17
- package/dist/common/index.js +11 -17
- package/dist/common/index.js.map +1 -1
- package/dist/common/index.types.d.ts +561 -0
- package/dist/common/index.types.js +4 -0
- package/dist/common/index.types.js.map +1 -0
- package/dist/common/inert.d.ts +74 -0
- package/dist/common/inert.js +302 -0
- package/dist/common/inert.js.map +1 -0
- package/dist/common/lifecycle.common.d.ts +26 -0
- package/dist/common/lifecycle.common.js +124 -0
- package/dist/common/lifecycle.common.js.map +1 -0
- package/dist/common/literal.pool.d.ts +23 -0
- package/dist/common/literal.pool.js +100 -0
- package/dist/common/literal.pool.js.map +1 -0
- package/dist/common/log.common.d.ts +81 -0
- package/dist/common/log.common.js +375 -0
- package/dist/common/log.common.js.map +1 -0
- package/dist/common/repo.common.d.ts +225 -0
- package/dist/common/repo.common.js +474 -0
- package/dist/common/repo.common.js.map +1 -0
- package/dist/const/index.d.ts +24 -19
- package/dist/const/index.js +25 -20
- package/dist/const/index.js.map +1 -1
- package/dist/error/caused.error.d.ts +1 -1
- package/dist/error/developer.error.d.ts +7 -7
- package/dist/error/developer.error.js +11 -29
- package/dist/error/developer.error.js.map +1 -1
- package/dist/error/http.error.d.ts +1 -1
- package/dist/error/http.error.js +3 -3
- package/dist/error/http.error.js.map +1 -1
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.js +1 -0
- package/dist/error/index.js.map +1 -1
- package/dist/error/index.types.d.ts +195 -0
- package/dist/error/index.types.js +3 -0
- package/dist/error/index.types.js.map +1 -0
- package/dist/error/invalid-value.error.js +1 -1
- package/dist/error/invalid-value.error.js.map +1 -1
- package/dist/error/leyyo.error.d.ts +9 -5
- package/dist/error/leyyo.error.js +37 -32
- package/dist/error/leyyo.error.js.map +1 -1
- package/dist/error/multiple.error.d.ts +1 -1
- package/dist/error/multiple.error.js.map +1 -1
- package/dist/function/define-loader.d.ts +8 -0
- package/dist/function/define-loader.js +23 -0
- package/dist/function/define-loader.js.map +1 -0
- package/dist/function/delete-prop.d.ts +24 -0
- package/dist/function/delete-prop.js +76 -0
- package/dist/function/delete-prop.js.map +1 -0
- package/dist/function/empty.fn.d.ts +1 -2
- package/dist/function/empty.fn.js.map +1 -1
- package/dist/function/extended-type.d.ts +1 -1
- package/dist/function/extended-type.js +8 -5
- package/dist/function/extended-type.js.map +1 -1
- package/dist/function/get-fqn.d.ts +8 -0
- package/dist/function/get-fqn.js +33 -0
- package/dist/function/get-fqn.js.map +1 -0
- package/dist/function/get-prop.d.ts +24 -0
- package/dist/function/get-prop.js +63 -0
- package/dist/function/get-prop.js.map +1 -0
- package/dist/function/has-fqn.d.ts +8 -0
- package/dist/function/has-fqn.js +32 -0
- package/dist/function/has-fqn.js.map +1 -0
- package/dist/function/index.d.ts +21 -3
- package/dist/function/index.js +21 -3
- package/dist/function/index.js.map +1 -1
- package/dist/function/index.types.d.ts +35 -0
- package/dist/function/index.types.js +4 -0
- package/dist/function/index.types.js.map +1 -0
- package/dist/function/is-anonymous-name.d.ts +1 -0
- package/dist/function/is-anonymous-name.js +11 -0
- package/dist/function/is-anonymous-name.js.map +1 -0
- package/dist/function/is-test.d.ts +10 -0
- package/dist/function/is-test.js +37 -0
- package/dist/function/is-test.js.map +1 -0
- package/dist/function/{is.js → is.fn.js} +1 -1
- package/dist/function/is.fn.js.map +1 -0
- package/dist/function/leyyo-fn.d.ts +3 -0
- package/dist/function/leyyo-fn.js +14 -0
- package/dist/function/leyyo-fn.js.map +1 -0
- package/dist/function/on-fqn-set.d.ts +2 -0
- package/dist/function/on-fqn-set.js +40 -0
- package/dist/function/on-fqn-set.js.map +1 -0
- package/dist/function/one-or-more.d.ts +1 -1
- package/dist/{common → function}/opt.fn.d.ts +2 -1
- package/dist/{common → function}/opt.fn.js +15 -10
- package/dist/function/opt.fn.js.map +1 -0
- package/dist/function/random-test-no.d.ts +6 -0
- package/dist/function/random-test-no.js +12 -0
- package/dist/function/random-test-no.js.map +1 -0
- package/dist/function/remove-fqn.d.ts +10 -0
- package/dist/function/remove-fqn.js +44 -0
- package/dist/function/remove-fqn.js.map +1 -0
- package/dist/{common/exporter.fn.d.ts → function/run-exporter.d.ts} +1 -1
- package/dist/{common/exporter.fn.js → function/run-exporter.js} +7 -3
- package/dist/function/run-exporter.js.map +1 -0
- package/dist/function/secure-clone.d.ts +1 -1
- package/dist/function/set-anonymous-fqn.d.ts +2 -0
- package/dist/function/set-anonymous-fqn.js +44 -0
- package/dist/function/set-anonymous-fqn.js.map +1 -0
- package/dist/function/set-anonymous-name.d.ts +2 -0
- package/dist/function/set-anonymous-name.js +66 -0
- package/dist/function/set-anonymous-name.js.map +1 -0
- package/dist/function/set-fqn.d.ts +9 -0
- package/dist/function/set-fqn.js +69 -0
- package/dist/function/set-fqn.js.map +1 -0
- package/dist/function/set-prop.d.ts +27 -0
- package/dist/function/set-prop.js +71 -0
- package/dist/function/set-prop.js.map +1 -0
- package/dist/function/stamp-loader.d.ts +8 -0
- package/dist/function/stamp-loader.js +18 -0
- package/dist/function/stamp-loader.js.map +1 -0
- package/dist/function/test-case.d.ts +8 -0
- package/dist/function/test-case.js +27 -0
- package/dist/function/test-case.js.map +1 -0
- package/dist/function/test-name.d.ts +8 -0
- package/dist/function/test-name.js +18 -0
- package/dist/function/test-name.js.map +1 -0
- package/dist/function/trigger-fqn.d.ts +2 -0
- package/dist/function/trigger-fqn.js +25 -0
- package/dist/function/trigger-fqn.js.map +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.foretell.js +8 -8
- package/dist/index.foretell.js.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.loader.d.ts +1 -1
- package/dist/index.loader.js +3 -3
- package/dist/index.loader.js.map +1 -1
- package/dist/init/index.d.ts +1 -1
- package/dist/init/index.js +4 -3
- package/dist/init/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/common/array.fn.d.ts +0 -46
- package/dist/common/array.fn.js +0 -131
- package/dist/common/array.fn.js.map +0 -1
- package/dist/common/deploy.fn.d.ts +0 -18
- package/dist/common/deploy.fn.js +0 -74
- package/dist/common/deploy.fn.js.map +0 -1
- package/dist/common/enum.fn.d.ts +0 -48
- package/dist/common/enum.fn.js +0 -133
- package/dist/common/enum.fn.js.map +0 -1
- package/dist/common/error.fn.d.ts +0 -100
- package/dist/common/error.fn.js +0 -401
- package/dist/common/error.fn.js.map +0 -1
- package/dist/common/event.fn.d.ts +0 -45
- package/dist/common/event.fn.js +0 -161
- package/dist/common/event.fn.js.map +0 -1
- package/dist/common/exporter.fn.js.map +0 -1
- package/dist/common/fqn.fn.d.ts +0 -31
- package/dist/common/fqn.fn.js +0 -197
- package/dist/common/fqn.fn.js.map +0 -1
- package/dist/common/inert.fn.d.ts +0 -69
- package/dist/common/inert.fn.js +0 -368
- package/dist/common/inert.fn.js.map +0 -1
- package/dist/common/lifecycle.fn.d.ts +0 -24
- package/dist/common/lifecycle.fn.js +0 -136
- package/dist/common/lifecycle.fn.js.map +0 -1
- package/dist/common/list.fn.d.ts +0 -47
- package/dist/common/list.fn.js +0 -132
- package/dist/common/list.fn.js.map +0 -1
- package/dist/common/loader.fn.d.ts +0 -15
- package/dist/common/loader.fn.js +0 -38
- package/dist/common/loader.fn.js.map +0 -1
- package/dist/common/log.fn.d.ts +0 -42
- package/dist/common/log.fn.js +0 -333
- package/dist/common/log.fn.js.map +0 -1
- package/dist/common/map.fn.d.ts +0 -46
- package/dist/common/map.fn.js +0 -131
- package/dist/common/map.fn.js.map +0 -1
- package/dist/common/name.fn.d.ts +0 -5
- package/dist/common/name.fn.js +0 -69
- package/dist/common/name.fn.js.map +0 -1
- package/dist/common/opt.fn.js.map +0 -1
- package/dist/common/set.fn.d.ts +0 -46
- package/dist/common/set.fn.js +0 -131
- package/dist/common/set.fn.js.map +0 -1
- package/dist/common/test.fn.d.ts +0 -26
- package/dist/common/test.fn.js +0 -81
- package/dist/common/test.fn.js.map +0 -1
- package/dist/function/error-obj.d.ts +0 -8
- package/dist/function/error-obj.js +0 -25
- package/dist/function/error-obj.js.map +0 -1
- package/dist/function/error-text.d.ts +0 -10
- package/dist/function/error-text.js +0 -43
- package/dist/function/error-text.js.map +0 -1
- package/dist/function/is.js.map +0 -1
- package/dist/type/index.d.ts +0 -551
- package/dist/type/index.js.map +0 -1
- /package/dist/function/{is.d.ts → is.fn.d.ts} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete target property
|
|
3
|
+
*
|
|
4
|
+
* @param {any} target - target
|
|
5
|
+
* @param {string} key - key
|
|
6
|
+
* @return {boolean} - is deleted?
|
|
7
|
+
* */
|
|
8
|
+
export declare function deleteKey(target: unknown, key: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Delete target hidden property
|
|
11
|
+
*
|
|
12
|
+
* @param {any} target - target
|
|
13
|
+
* @param {symbol} key - hidden key
|
|
14
|
+
* @return {boolean} - is deleted?
|
|
15
|
+
* */
|
|
16
|
+
export declare function deleteSymbol(target: unknown, key: symbol): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Delete target property
|
|
19
|
+
*
|
|
20
|
+
* @param {any} target - target
|
|
21
|
+
* @param {(symbol|string)} key - key
|
|
22
|
+
* @return {boolean} - is deleted?
|
|
23
|
+
* */
|
|
24
|
+
export declare function deleteProp(target: unknown, key: symbol | string): boolean;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteKey = deleteKey;
|
|
4
|
+
exports.deleteSymbol = deleteSymbol;
|
|
5
|
+
exports.deleteProp = deleteProp;
|
|
6
|
+
const internal_1 = require("../internal");
|
|
7
|
+
const test_case_1 = require("./test-case");
|
|
8
|
+
const leyyo_fn_1 = require("./leyyo-fn");
|
|
9
|
+
const where = `${internal_1.FQN}.DeleteProp`;
|
|
10
|
+
let _leyyo;
|
|
11
|
+
/**
|
|
12
|
+
* Delete target property
|
|
13
|
+
*
|
|
14
|
+
* @param {any} target - target
|
|
15
|
+
* @param {string} key - key
|
|
16
|
+
* @return {boolean} - is deleted?
|
|
17
|
+
* */
|
|
18
|
+
function deleteKey(target, key) {
|
|
19
|
+
if (typeof key !== 'string') {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return deleteProp(target, key);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Delete target hidden property
|
|
26
|
+
*
|
|
27
|
+
* @param {any} target - target
|
|
28
|
+
* @param {symbol} key - hidden key
|
|
29
|
+
* @return {boolean} - is deleted?
|
|
30
|
+
* */
|
|
31
|
+
function deleteSymbol(target, key) {
|
|
32
|
+
if (typeof key !== 'symbol') {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return deleteProp(target, key);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Delete target property
|
|
39
|
+
*
|
|
40
|
+
* @param {any} target - target
|
|
41
|
+
* @param {(symbol|string)} key - key
|
|
42
|
+
* @return {boolean} - is deleted?
|
|
43
|
+
* */
|
|
44
|
+
function deleteProp(target, key) {
|
|
45
|
+
if (!['symbol', 'string'].includes(typeof key)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (!target || !['object', 'function'].includes(typeof target)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
delete target[key];
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
// nothing
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
Object.defineProperty(target, key, {
|
|
60
|
+
value: undefined,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: false,
|
|
63
|
+
enumerable: typeof key === 'string',
|
|
64
|
+
});
|
|
65
|
+
delete target[key];
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
if (!_leyyo) {
|
|
70
|
+
_leyyo = (0, leyyo_fn_1.$$get_leyyo_fn)();
|
|
71
|
+
}
|
|
72
|
+
new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log(e);
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=delete-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CAAC,MAAM,EAAE,GAAG,EAAE;YAC/B,KAAK,EAAE,SAAS;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,OAAO,GAAG,KAAK,QAAQ;SACtC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,IAAK,CAAC,MAAM,EAAE,CAAC;YACX,MAAM,GAAG,IAAA,yBAAc,GAAE,CAAC;QAC9B,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,CAAC,qCAAqC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAA,oBAAQ,EAAC,cAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtH,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Arr } from "../type";
|
|
2
1
|
/**
|
|
3
2
|
* Empty function, it can be more useful sometimes
|
|
4
3
|
*
|
|
5
4
|
* @param {Arr} _args - insignificant parameters
|
|
6
5
|
* @return {any}
|
|
7
6
|
* */
|
|
8
|
-
export declare function emptyFn<R = unknown>(..._args:
|
|
7
|
+
export declare function emptyFn<R = unknown>(..._args: Array<unknown>): R | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.fn.js","sourceRoot":"","sources":["../../src/function/empty.fn.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"empty.fn.js","sourceRoot":"","sources":["../../src/function/empty.fn.ts"],"names":[],"mappings":";;AAOA,0BACC;AARD,qCAAqC;AACrC;;;;;KAKK;AACL,SAAgB,OAAO,CAAc,GAAG,KAAqB;AAC7D,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extendedType = extendedType;
|
|
4
|
-
const is_1 = require("./is");
|
|
5
4
|
const class_1 = require("../class");
|
|
6
5
|
const const_1 = require("../const");
|
|
6
|
+
const is_fn_1 = require("./is.fn");
|
|
7
7
|
// noinspection JSUnusedGlobalSymbols
|
|
8
8
|
/**
|
|
9
9
|
* Get extended type of value
|
|
@@ -32,8 +32,8 @@ function extendedType(value) {
|
|
|
32
32
|
return 'null';
|
|
33
33
|
}
|
|
34
34
|
if (Array.isArray(value)) {
|
|
35
|
-
if (value[const_1.
|
|
36
|
-
return '
|
|
35
|
+
if (value[const_1.KEY_LITERAL_NAME]) {
|
|
36
|
+
return 'literal-items';
|
|
37
37
|
}
|
|
38
38
|
return (value instanceof class_1.List) ? 'list' : 'array';
|
|
39
39
|
}
|
|
@@ -46,9 +46,12 @@ function extendedType(value) {
|
|
|
46
46
|
if (value instanceof Set) {
|
|
47
47
|
return 'set';
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
if (value[const_1.KEY_ENUM_NAME]) {
|
|
50
|
+
return 'enum-map';
|
|
51
|
+
}
|
|
52
|
+
return 'object';
|
|
50
53
|
case "function":
|
|
51
|
-
return (0,
|
|
54
|
+
return (0, is_fn_1.isClass)(value) ? 'class' : 'function';
|
|
52
55
|
default:
|
|
53
56
|
return typeof value;
|
|
54
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extended-type.js","sourceRoot":"","sources":["../../src/function/extended-type.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extended-type.js","sourceRoot":"","sources":["../../src/function/extended-type.ts"],"names":[],"mappings":";;AAaA,oCA4CC;AAxDD,oCAA8B;AAC9B,oCAAyD;AACzD,mCAAgC;AAGhC,qCAAqC;AACrC;;;;;KAKK;AACL,SAAgB,YAAY,CAAC,KAAc;IACvC,QAAQ,OAAO,KAAK,EAAE,CAAC;QACnB,KAAK,QAAQ;YACT,MAAM,OAAO,GAAG,KAA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O,OAAO,KAAK,CAAC;IAC5B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFqn = getFqn;
|
|
4
|
+
const const_1 = require("../const");
|
|
5
|
+
/**
|
|
6
|
+
* Get fqn name
|
|
7
|
+
*
|
|
8
|
+
* @param {FqnTarget} target - target (function, class, instance, enum, literal)
|
|
9
|
+
* @return {string} - fully qualified name
|
|
10
|
+
* */
|
|
11
|
+
function getFqn(target) {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
if (!target) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
if (typeof target === 'function') { // function, class
|
|
17
|
+
return (_a = target[const_1.KEY_FQN_NAME]) !== null && _a !== void 0 ? _a : target.name;
|
|
18
|
+
}
|
|
19
|
+
else if (typeof target === 'object') {
|
|
20
|
+
if (Array.isArray(target)) {
|
|
21
|
+
if (target[const_1.KEY_LITERAL_NAME]) {
|
|
22
|
+
return (_b = target[const_1.KEY_FQN_NAME]) !== null && _b !== void 0 ? _b : target[const_1.KEY_LITERAL_NAME];
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
if (target[const_1.KEY_ENUM_NAME]) {
|
|
27
|
+
return (_c = target[const_1.KEY_FQN_NAME]) !== null && _c !== void 0 ? _c : target[const_1.KEY_ENUM_NAME];
|
|
28
|
+
}
|
|
29
|
+
return target.constructor !== Object ? getFqn(target.constructor) : undefined;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=get-fqn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-fqn.js","sourceRoot":"","sources":["../../src/function/get-fqn.ts"],"names":[],"mappings":";;AASA,wBAoBC;AA7BD,oCAAuE;AAGvE;;;;;KAKK;AACL,SAAgB,MAAM,CAAC,MAAiB;;IACpC,IAAK,CAAC,MAAM,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC,CAAC,kBAAkB;QAClD,OAAO,MAAA,MAAM,CAAC,oBAAY,CAAC,mCAAI,MAAM,CAAC,IAAI,CAAC;IAC/C,CAAC;SACI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,MAAM,CAAC,wBAAgB,CAAC,EAAE,CAAC;gBAC3B,OAAO,MAAA,MAAM,CAAC,oBAAY,CAAC,mCAAI,MAAM,CAAC,wBAAgB,CAAC,CAAC;YAC5D,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,MAAM,CAAC,qBAAa,CAAC,EAAE,CAAC;YACxB,OAAO,MAAA,MAAM,CAAC,oBAAY,CAAC,mCAAI,MAAM,CAAC,qBAAa,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get target property
|
|
3
|
+
*
|
|
4
|
+
* @param {any} target - target
|
|
5
|
+
* @param {string} key - key
|
|
6
|
+
* @return {any}
|
|
7
|
+
* */
|
|
8
|
+
export declare function getKey<T>(target: unknown, key: string): T;
|
|
9
|
+
/**
|
|
10
|
+
* Get target hidden property
|
|
11
|
+
*
|
|
12
|
+
* @param {any} target - target
|
|
13
|
+
* @param {symbol} key - hidden key
|
|
14
|
+
* @return {any}
|
|
15
|
+
* */
|
|
16
|
+
export declare function getSymbol<T>(target: unknown, key: symbol): T;
|
|
17
|
+
/**
|
|
18
|
+
* Get target property
|
|
19
|
+
*
|
|
20
|
+
* @param {any} target - target
|
|
21
|
+
* @param {(symbol|string)} key - key
|
|
22
|
+
* @return {any}
|
|
23
|
+
* */
|
|
24
|
+
export declare function getProp<T>(target: unknown, key: symbol | string): T;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKey = getKey;
|
|
4
|
+
exports.getSymbol = getSymbol;
|
|
5
|
+
exports.getProp = getProp;
|
|
6
|
+
const internal_1 = require("../internal");
|
|
7
|
+
const test_case_1 = require("./test-case");
|
|
8
|
+
const leyyo_fn_1 = require("./leyyo-fn");
|
|
9
|
+
const where = `${internal_1.FQN}.GetProp`;
|
|
10
|
+
let _leyyo;
|
|
11
|
+
/**
|
|
12
|
+
* Get target property
|
|
13
|
+
*
|
|
14
|
+
* @param {any} target - target
|
|
15
|
+
* @param {string} key - key
|
|
16
|
+
* @return {any}
|
|
17
|
+
* */
|
|
18
|
+
function getKey(target, key) {
|
|
19
|
+
if (typeof key !== 'string') {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return getProp(target, key);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get target hidden property
|
|
26
|
+
*
|
|
27
|
+
* @param {any} target - target
|
|
28
|
+
* @param {symbol} key - hidden key
|
|
29
|
+
* @return {any}
|
|
30
|
+
* */
|
|
31
|
+
function getSymbol(target, key) {
|
|
32
|
+
if (typeof key !== 'symbol') {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
return getProp(target, key);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get target property
|
|
39
|
+
*
|
|
40
|
+
* @param {any} target - target
|
|
41
|
+
* @param {(symbol|string)} key - key
|
|
42
|
+
* @return {any}
|
|
43
|
+
* */
|
|
44
|
+
function getProp(target, key) {
|
|
45
|
+
if (!['symbol', 'string'].includes(typeof key)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (!target || !['object', 'function'].includes(typeof target)) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const prop = Object.getOwnPropertyDescriptor(target, key);
|
|
53
|
+
return prop === null || prop === void 0 ? void 0 : prop.value;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (!_leyyo) {
|
|
57
|
+
_leyyo = (0, leyyo_fn_1.$$get_leyyo_fn)();
|
|
58
|
+
}
|
|
59
|
+
new _leyyo.developerError(`Unexpected error during set name [${key.toString()}]`, (0, test_case_1.testCase)(internal_1.FQN, 'ZZZ'), where).log(e);
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=get-prop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-prop.js","sourceRoot":"","sources":["../../src/function/get-prop.ts"],"names":[],"mappings":";;AAeA,wBAKC;AASD,8BAKC;AASD,0BAiBC;AA5DD,0CAAgC;AAChC,2CAAqC;AAErC,yCAA0C;AAE1C,MAAM,KAAK,GAAG,GAAG,cAAG,UAAU,CAAC;AAC/B,IAAI,MAAiB,CAAC;AAEtB;;;;;;KAMK;AACL,SAAgB,MAAM,CAAI,MAAe,EAAE,GAAW;IAClD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;KAMK;AACL,SAAgB,SAAS,CAAI,MAAe,EAAE,GAAW;IACrD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;KAMK;AACL,SAAgB,OAAO,CAAI,MAAe,EAAE,GAAoB;IAC5D,IAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAK,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1D,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,IAAK,CAAC,MAAM,EAAE,CAAC;YACX,MAAM,GAAG,IAAA,yBAAc,GAAE,CAAC;QAC9B,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,CAAC,qCAAqC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAA,oBAAQ,EAAC,cAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtH,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasFqn = hasFqn;
|
|
4
|
+
const const_1 = require("../const");
|
|
5
|
+
/**
|
|
6
|
+
* Get fqn name
|
|
7
|
+
*
|
|
8
|
+
* @param {FqnTarget} target - target (function, class, instance, enum, literal)
|
|
9
|
+
* @return {string} - fully qualified name
|
|
10
|
+
* */
|
|
11
|
+
function hasFqn(target) {
|
|
12
|
+
if (!target) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (typeof target === 'function') { // function, class
|
|
16
|
+
return !!target[const_1.KEY_FQN_NAME];
|
|
17
|
+
}
|
|
18
|
+
else if (typeof target === 'object') {
|
|
19
|
+
if (Array.isArray(target)) {
|
|
20
|
+
if (target[const_1.KEY_LITERAL_NAME]) {
|
|
21
|
+
return !!target[const_1.KEY_FQN_NAME];
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (target[const_1.KEY_ENUM_NAME]) {
|
|
26
|
+
return !!target[const_1.KEY_FQN_NAME];
|
|
27
|
+
}
|
|
28
|
+
return target.constructor !== Object ? hasFqn(target.constructor) : false;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=has-fqn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-fqn.js","sourceRoot":"","sources":["../../src/function/has-fqn.ts"],"names":[],"mappings":";;AASA,wBAoBC;AA7BD,oCAAuE;AAGvE;;;;;KAKK;AACL,SAAgB,MAAM,CAAC,MAAiB;IACpC,IAAK,CAAC,MAAM,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC,CAAC,kBAAkB;QAClD,OAAO,CAAC,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;IAClC,CAAC;SACI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,MAAM,CAAC,wBAAgB,CAAC,EAAE,CAAC;gBAC3B,OAAO,CAAC,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,MAAM,CAAC,qBAAa,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9E,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/dist/function/index.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
export * from './index.types';
|
|
1
2
|
export * from './delay';
|
|
3
|
+
export * from './delete-prop';
|
|
2
4
|
export * from './empty.fn';
|
|
3
|
-
export * from './error-text';
|
|
4
|
-
export * from './error-obj';
|
|
5
5
|
export * from './extended-type';
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './get-fqn';
|
|
7
|
+
export * from './set-fqn';
|
|
8
|
+
export * from './remove-fqn';
|
|
9
|
+
export * from './on-fqn-set';
|
|
10
|
+
export * from './set-anonymous-fqn';
|
|
11
|
+
export * from './get-prop';
|
|
12
|
+
export * from './has-fqn';
|
|
13
|
+
export * from './is.fn';
|
|
14
|
+
export * from './is-anonymous-name';
|
|
7
15
|
export * from './jitter-interval';
|
|
16
|
+
export * from './define-loader';
|
|
17
|
+
export * from './stamp-loader';
|
|
8
18
|
export * from './one-or-more';
|
|
19
|
+
export * from './opt.fn';
|
|
20
|
+
export * from './run-exporter';
|
|
9
21
|
export * from './secure-clone';
|
|
10
22
|
export * from './secure-json';
|
|
23
|
+
export * from './set-anonymous-name';
|
|
24
|
+
export * from './set-prop';
|
|
25
|
+
export * from './test-case';
|
|
26
|
+
export * from './test-name';
|
|
27
|
+
export * from './random-test-no';
|
|
28
|
+
export * from './is-test';
|
package/dist/function/index.js
CHANGED
|
@@ -14,14 +14,32 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./index.types"), exports);
|
|
17
18
|
__exportStar(require("./delay"), exports);
|
|
19
|
+
__exportStar(require("./delete-prop"), exports);
|
|
18
20
|
__exportStar(require("./empty.fn"), exports);
|
|
19
|
-
__exportStar(require("./error-text"), exports);
|
|
20
|
-
__exportStar(require("./error-obj"), exports);
|
|
21
21
|
__exportStar(require("./extended-type"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
22
|
+
__exportStar(require("./get-fqn"), exports);
|
|
23
|
+
__exportStar(require("./set-fqn"), exports);
|
|
24
|
+
__exportStar(require("./remove-fqn"), exports);
|
|
25
|
+
__exportStar(require("./on-fqn-set"), exports);
|
|
26
|
+
__exportStar(require("./set-anonymous-fqn"), exports);
|
|
27
|
+
__exportStar(require("./get-prop"), exports);
|
|
28
|
+
__exportStar(require("./has-fqn"), exports);
|
|
29
|
+
__exportStar(require("./is.fn"), exports);
|
|
30
|
+
__exportStar(require("./is-anonymous-name"), exports);
|
|
23
31
|
__exportStar(require("./jitter-interval"), exports);
|
|
32
|
+
__exportStar(require("./define-loader"), exports);
|
|
33
|
+
__exportStar(require("./stamp-loader"), exports);
|
|
24
34
|
__exportStar(require("./one-or-more"), exports);
|
|
35
|
+
__exportStar(require("./opt.fn"), exports);
|
|
36
|
+
__exportStar(require("./run-exporter"), exports);
|
|
25
37
|
__exportStar(require("./secure-clone"), exports);
|
|
26
38
|
__exportStar(require("./secure-json"), exports);
|
|
39
|
+
__exportStar(require("./set-anonymous-name"), exports);
|
|
40
|
+
__exportStar(require("./set-prop"), exports);
|
|
41
|
+
__exportStar(require("./test-case"), exports);
|
|
42
|
+
__exportStar(require("./test-name"), exports);
|
|
43
|
+
__exportStar(require("./random-test-no"), exports);
|
|
44
|
+
__exportStar(require("./is-test"), exports);
|
|
27
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/function/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,+CAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/function/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAE9B,0CAAwB;AACxB,gDAA8B;AAC9B,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B;AAC7B,+CAA6B;AAC7B,sDAAoC;AACpC,6CAA2B;AAC3B,4CAA0B;AAC1B,0CAAwB;AACxB,sDAAoC;AACpC,oDAAkC;AAClC,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,uDAAqC;AACrC,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,mDAAiC;AACjC,4CAA0B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ClassLike, Describable, ExtendedType, Fnc, Obj, OneOrMore, SetOrMore } from "../base";
|
|
2
|
+
import { Enum, Literal } from "../common";
|
|
3
|
+
export type FqnTarget = ClassLike | Fnc | Obj | Enum | Literal;
|
|
4
|
+
export type FqnOnSetLambda = (full: string) => void;
|
|
5
|
+
export type LoaderLike = Array<LoaderItem>;
|
|
6
|
+
export type LeyyoStampLambda = () => LoaderItem;
|
|
7
|
+
export type LeyyoStampEmpty = () => symbol;
|
|
8
|
+
export type LoaderItem = ClassLike | Fnc | Enum | Literal | Obj | LeyyoStampLambda | LeyyoStampEmpty | LoaderLike;
|
|
9
|
+
export type OptReason = 'invalid' | 'unexpected' | 'not:allowed' | 'not:found' | 'duplicated' | 'empty' | 'conflicted';
|
|
10
|
+
export interface Opt<R extends string = string> extends Obj {
|
|
11
|
+
issue?: SetOrMore<OptReason | R | string>;
|
|
12
|
+
message?: SetOrMore<string>;
|
|
13
|
+
field?: string;
|
|
14
|
+
param?: SetOrMore<unknown>;
|
|
15
|
+
where?: SetOrMore<string>;
|
|
16
|
+
value?: SetOrMore<unknown>;
|
|
17
|
+
expected?: SetOrMore<ExtendedType | string> | OneOrMore<ExtendedType | string>;
|
|
18
|
+
type?: SetOrMore<ExtendedType | string>;
|
|
19
|
+
method?: SetOrMore<string>;
|
|
20
|
+
case?: SetOrMore<unknown>;
|
|
21
|
+
desc?: SetOrMore<Describable | string>;
|
|
22
|
+
error?: SetOrMore<{
|
|
23
|
+
name: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
assert?: SetOrMore<string>;
|
|
27
|
+
[k: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export type OptFn<O extends Opt = Opt> = () => O;
|
|
30
|
+
export type OptAny<O extends Opt = Opt> = O | OptFn<O>;
|
|
31
|
+
export type ExporterData = Record<string, ExporterValue>;
|
|
32
|
+
export type ExporterValue = Record<string, unknown>;
|
|
33
|
+
export interface ExporterDepot {
|
|
34
|
+
add(name: string, value: ExporterValue): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.types.js","sourceRoot":"","sources":["../../src/function/index.types.ts"],"names":[],"mappings":";;AAyDA,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isAnonymousName(name: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAnonymousName = isAnonymousName;
|
|
4
|
+
const const_1 = require("../const");
|
|
5
|
+
function isAnonymousName(name) {
|
|
6
|
+
if (typeof name === 'string') {
|
|
7
|
+
return name.trim().startsWith(const_1.VAL_NAME_ANONYMOUS);
|
|
8
|
+
}
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=is-anonymous-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-anonymous-name.js","sourceRoot":"","sources":["../../src/function/is-anonymous-name.ts"],"names":[],"mappings":";;AAEA,0CAKC;AAPD,oCAA4C;AAE5C,SAAgB,eAAe,CAAC,IAAY;IACxC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,0BAAkB,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// noinspection JSUnusedGlobalSymbols
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.initTest = initTest;
|
|
5
|
+
exports.isTest = isTest;
|
|
6
|
+
// region properties
|
|
7
|
+
/**
|
|
8
|
+
* Is test?
|
|
9
|
+
* */
|
|
10
|
+
let _isTest;
|
|
11
|
+
// endregion properties
|
|
12
|
+
/**
|
|
13
|
+
* Initialize test
|
|
14
|
+
* */
|
|
15
|
+
function initTest() {
|
|
16
|
+
_isTest = true;
|
|
17
|
+
if (global) {
|
|
18
|
+
if (!global.leyyo_is_testing) {
|
|
19
|
+
global.leyyo_is_testing = true;
|
|
20
|
+
['log', 'warn', 'info', 'debug', 'trace', 'error', 'fatal'].forEach(name => {
|
|
21
|
+
global.console[name] = () => {
|
|
22
|
+
};
|
|
23
|
+
console[name] = () => {
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Is test?
|
|
31
|
+
*
|
|
32
|
+
* @return {boolean}
|
|
33
|
+
* */
|
|
34
|
+
function isTest() {
|
|
35
|
+
return _isTest;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=is-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-test.js","sourceRoot":"","sources":["../../src/function/is-test.ts"],"names":[],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
3
|
+
exports.$$set_leyyo_fn = $$set_leyyo_fn;
|
|
4
|
+
exports.$$get_leyyo_fn = $$get_leyyo_fn;
|
|
5
|
+
let _leyyo;
|
|
6
|
+
function $$set_leyyo_fn(leyyo) {
|
|
7
|
+
if (!_leyyo && leyyo) {
|
|
8
|
+
_leyyo = leyyo;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function $$get_leyyo_fn() {
|
|
12
|
+
return _leyyo;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=leyyo-fn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leyyo-fn.js","sourceRoot":"","sources":["../../src/function/leyyo-fn.ts"],"names":[],"mappings":";;AAIA,wCAIC;AAED,wCAEC;AAVD,IAAI,MAAiB,CAAC;AAEtB,SAAgB,cAAc,CAAC,KAAgB;IAC3C,IAAK,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,MAAM,GAAG,KAAK,CAAC;IACnB,CAAC;AACL,CAAC;AAED,SAAgB,cAAc;IAC1B,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onFqnSet = onFqnSet;
|
|
4
|
+
const const_1 = require("../const");
|
|
5
|
+
function onFqnSet(target, callback) {
|
|
6
|
+
if (!target) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (typeof callback !== 'function') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (typeof target === 'function') { // function, class
|
|
13
|
+
return _item(target, callback);
|
|
14
|
+
}
|
|
15
|
+
else if (typeof target === 'object') {
|
|
16
|
+
if (Array.isArray(target)) {
|
|
17
|
+
if (target[const_1.KEY_LITERAL_NAME]) {
|
|
18
|
+
return _item(target, callback);
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (target[const_1.KEY_ENUM_NAME]) {
|
|
23
|
+
return _item(target, callback);
|
|
24
|
+
}
|
|
25
|
+
return target.constructor !== Object ? onFqnSet(target.constructor, callback) : false;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function _item(target, callback) {
|
|
30
|
+
if (target[const_1.KEY_FQN_NAME]) {
|
|
31
|
+
callback(target[const_1.KEY_FQN_NAME]);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (!target[const_1.KEY_FQN_ON_SET]) {
|
|
35
|
+
target[const_1.KEY_FQN_ON_SET] = [];
|
|
36
|
+
}
|
|
37
|
+
target[const_1.KEY_FQN_ON_SET].push(callback);
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=on-fqn-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-fqn-set.js","sourceRoot":"","sources":["../../src/function/on-fqn-set.ts"],"names":[],"mappings":";;AAGA,4BAuBC;AA1BD,oCAAuF;AAGvF,SAAgB,QAAQ,CAAC,MAAiB,EAAE,QAAwB;IAChE,IAAK,CAAC,MAAM,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC,CAAC,kBAAkB;QAClD,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;SACI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,MAAM,CAAC,wBAAgB,CAAC,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,K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