mnemonica 0.9.957 → 0.9.958
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/build/index.d.ts +3 -9
- package/build/index.js +22 -19
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export declare const define: <T extends RN, P extends object, N extends Proto<P,
|
|
|
18
18
|
define: IDefinitor<N, SubTypeName>;
|
|
19
19
|
}>(this: unknown, TypeName?: string, constructHandler?: IDEF<T> | undefined, proto?: P | undefined, config?: {}) => R;
|
|
20
20
|
export declare const lookup: TypeLookup;
|
|
21
|
+
export declare const apply: <E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args?: unknown[]) => { [key in keyof S]: S[key]; };
|
|
22
|
+
export declare const call: <E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, ...args: unknown[]) => { [key in keyof S]: S[key]; };
|
|
23
|
+
export declare const bind: <E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>) => (...args: unknown[]) => { [key in keyof S]: S[key]; };
|
|
21
24
|
export declare const mnemonica: {
|
|
22
25
|
[index: string]: unknown;
|
|
23
26
|
};
|
|
@@ -26,12 +29,3 @@ export declare const defaultCollection: any;
|
|
|
26
29
|
export declare const errors: any;
|
|
27
30
|
export { utils } from './utils';
|
|
28
31
|
export { defineStackCleaner } from './utils';
|
|
29
|
-
export declare function apply<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args?: unknown[]): {
|
|
30
|
-
[key in keyof S]: S[key];
|
|
31
|
-
};
|
|
32
|
-
export declare function call<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, ...args: unknown[]): {
|
|
33
|
-
[key in keyof S]: S[key];
|
|
34
|
-
};
|
|
35
|
-
export declare function bind<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>): (...args: unknown[]) => {
|
|
36
|
-
[key in keyof S]: S[key];
|
|
37
|
-
};
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defineStackCleaner = exports.utils = exports.errors = exports.defaultCollection = exports.createTypesCollection = exports.defaultNamespace = exports.namespaces = exports.createNamespace = exports.ErrorMessages = exports.TYPE_TITLE_PREFIX = exports.URANUS = exports.GAIA = exports.MNEMOSYNE = exports.MNEMONICA = exports.SymbolConfig = exports.SymbolDefaultTypesCollection = exports.SymbolDefaultNamespace = exports.SymbolReplaceGaia = exports.SymbolGaia = exports.SymbolConstructorName = exports.SymbolSubtypeCollection = exports.mnemonica = exports.bind = exports.call = exports.apply = exports.lookup = exports.define = exports.defaultTypes = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
5
|
const { odp } = constants_1.constants;
|
|
6
6
|
const errorsApi = require("./api/errors");
|
|
@@ -18,8 +18,28 @@ exports.lookup = function (TypeNestedPath) {
|
|
|
18
18
|
const types = checkThis(this) ? exports.defaultTypes : this || exports.defaultTypes;
|
|
19
19
|
return types.lookup(TypeNestedPath);
|
|
20
20
|
};
|
|
21
|
+
const apply = function (entity, Constructor, args) {
|
|
22
|
+
const result = Constructor.apply(entity, args);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
exports.apply = apply;
|
|
26
|
+
const call = function (entity, Constructor, ...args) {
|
|
27
|
+
const result = Constructor.call(entity, ...args);
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
exports.call = call;
|
|
31
|
+
const bind = function (entity, Constructor) {
|
|
32
|
+
return (...args) => {
|
|
33
|
+
const result = Constructor.call(entity, ...args);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.bind = bind;
|
|
21
38
|
exports.mnemonica = Object.entries(Object.assign(Object.assign(Object.assign({ define: exports.define,
|
|
22
|
-
lookup: exports.lookup
|
|
39
|
+
lookup: exports.lookup,
|
|
40
|
+
apply: exports.apply,
|
|
41
|
+
call: exports.call,
|
|
42
|
+
bind: exports.bind }, descriptors_1.descriptors), errorsApi), constants_1.constants)).reduce((acc, entry) => {
|
|
23
43
|
const [name, code] = entry;
|
|
24
44
|
odp(acc, name, {
|
|
25
45
|
get() {
|
|
@@ -36,20 +56,3 @@ var utils_1 = require("./utils");
|
|
|
36
56
|
Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return utils_1.utils; } });
|
|
37
57
|
var utils_2 = require("./utils");
|
|
38
58
|
Object.defineProperty(exports, "defineStackCleaner", { enumerable: true, get: function () { return utils_2.defineStackCleaner; } });
|
|
39
|
-
function apply(entity, Constructor, args) {
|
|
40
|
-
const result = Constructor.apply(entity, args);
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
exports.apply = apply;
|
|
44
|
-
function call(entity, Constructor, ...args) {
|
|
45
|
-
const result = Constructor.call(entity, ...args);
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
exports.call = call;
|
|
49
|
-
function bind(entity, Constructor) {
|
|
50
|
-
return (...args) => {
|
|
51
|
-
const result = Constructor.call(entity, ...args);
|
|
52
|
-
return result;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.bind = bind;
|