mnemonica 0.9.978 → 0.9.981
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 +2 -0
- package/build/index.js +18 -2
- package/package.json +10 -11
package/build/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export declare const lookup: TypeLookup;
|
|
|
36
36
|
export declare const apply: <E extends object, T extends object, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args?: unknown[]) => { [key in keyof S]: S[key]; };
|
|
37
37
|
export declare const call: <E extends object, T extends object, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, ...args: unknown[]) => { [key in keyof S]: S[key]; };
|
|
38
38
|
export declare const bind: <E extends object, T extends object, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>) => (...args: unknown[]) => { [key in keyof S]: S[key]; };
|
|
39
|
+
export declare const decorate: (parentClass?: unknown, proto?: object, config?: constructorOptions) => <T extends new () => unknown>(cstr: T, s: ClassDecoratorContext<T>) => T;
|
|
40
|
+
export declare const registerHook: <T extends object>(Constructor: IDEF<T>, hookType: hooksTypes, cb: hook) => void;
|
|
39
41
|
export declare const mnemonica: {
|
|
40
42
|
[index: string]: unknown;
|
|
41
43
|
};
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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.registerHook = exports.decorate = 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");
|
|
@@ -35,11 +35,27 @@ const bind = function (entity, Constructor) {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
exports.bind = bind;
|
|
38
|
+
const decorate = function (parentClass = undefined, proto, config) {
|
|
39
|
+
const decorator = function (cstr, s) {
|
|
40
|
+
if (parentClass === undefined) {
|
|
41
|
+
return (0, exports.define)(s.name, cstr, proto, config);
|
|
42
|
+
}
|
|
43
|
+
return parentClass.define(s.name, cstr, proto, config);
|
|
44
|
+
};
|
|
45
|
+
return decorator;
|
|
46
|
+
};
|
|
47
|
+
exports.decorate = decorate;
|
|
48
|
+
const registerHook = function (Constructor, hookType, cb) {
|
|
49
|
+
Constructor.registerHook(hookType, cb);
|
|
50
|
+
};
|
|
51
|
+
exports.registerHook = registerHook;
|
|
38
52
|
exports.mnemonica = Object.entries(Object.assign(Object.assign(Object.assign({ define: exports.define,
|
|
39
53
|
lookup: exports.lookup,
|
|
40
54
|
apply: exports.apply,
|
|
41
55
|
call: exports.call,
|
|
42
|
-
bind: exports.bind
|
|
56
|
+
bind: exports.bind,
|
|
57
|
+
decorate: exports.decorate,
|
|
58
|
+
registerHook: exports.registerHook }, descriptors_1.descriptors), errorsApi), constants_1.constants)).reduce((acc, entry) => {
|
|
43
59
|
const [name, code] = entry;
|
|
44
60
|
odp(acc, name, {
|
|
45
61
|
get() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mnemonica",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.981",
|
|
4
4
|
"description": "abstract technique that aids information retention : instance inheritance system",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -63,25 +63,24 @@
|
|
|
63
63
|
},
|
|
64
64
|
"homepage": "https://github.com/wentout/mnemonica#readme",
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/jest": "^29.5.
|
|
67
|
-
"@types/node": "^18.
|
|
66
|
+
"@types/jest": "^29.5.12",
|
|
67
|
+
"@types/node": "^18.19.21",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
69
69
|
"@typescript-eslint/parser": "^5.62.0",
|
|
70
|
-
"chai": "^4.
|
|
71
|
-
"eslint": "^8.
|
|
72
|
-
"eslint-plugin-import": "^2.29.
|
|
73
|
-
"eslint-plugin-mocha": "^10.
|
|
70
|
+
"chai": "^4.4.1",
|
|
71
|
+
"eslint": "^8.57.0",
|
|
72
|
+
"eslint-plugin-import": "^2.29.1",
|
|
73
|
+
"eslint-plugin-mocha": "^10.3.0",
|
|
74
74
|
"eslint-plugin-no-arrow-this": "^1.2.0",
|
|
75
75
|
"husky": "^8.0.3",
|
|
76
76
|
"jest": "^29.7.0",
|
|
77
77
|
"json5": "^2.2.3",
|
|
78
78
|
"lint-staged": "^13.3.0",
|
|
79
|
-
"mocha": "^10.
|
|
79
|
+
"mocha": "^10.3.0",
|
|
80
80
|
"mocha-lcov-reporter": "^1.3.0",
|
|
81
81
|
"nyc": "^15.1.0",
|
|
82
|
-
"ts-jest": "^29.1.
|
|
83
|
-
"typescript": "^5.
|
|
84
|
-
"yaml": "^2.3.4"
|
|
82
|
+
"ts-jest": "^29.1.2",
|
|
83
|
+
"typescript": "^5.3.3"
|
|
85
84
|
},
|
|
86
85
|
"engines": {
|
|
87
86
|
"node": ">=14"
|