mnemonica 0.9.951 → 0.9.953
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/api/errors/index.js +2 -2
- package/build/api/hooks/flowCheckers.d.ts +1 -1
- package/build/api/index.d.ts +1 -1
- package/build/api/types/Mnemosyne.d.ts +1 -1
- package/build/api/types/Mnemosyne.js +4 -4
- package/build/api/types/createInstanceModificator.js +0 -1
- package/build/api/types/createInstanceModificator200XthWay.js +0 -1
- package/build/api/utils/index.d.ts +1 -1
- package/build/index.d.ts +15 -3
- package/build/index.js +3 -4
- package/build/types/index.d.ts +14 -14
- package/package.json +12 -15
|
@@ -67,7 +67,7 @@ const constructError = (name, message) => {
|
|
|
67
67
|
};
|
|
68
68
|
return ${name};
|
|
69
69
|
`;
|
|
70
|
-
const
|
|
71
|
-
return
|
|
70
|
+
const NamedErrorConstructor = (new Function('base', body))(BASE_MNEMONICA_ERROR);
|
|
71
|
+
return NamedErrorConstructor;
|
|
72
72
|
};
|
|
73
73
|
exports.constructError = constructError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const flowCheckers: WeakMap<object, any>;
|
|
2
|
-
export declare const registerFlowChecker: (this: any, cb:
|
|
2
|
+
export declare const registerFlowChecker: (this: any, cb: () => unknown) => void;
|
package/build/api/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const hooks: {
|
|
|
4
4
|
[index: string]: any;
|
|
5
5
|
}) => Set<unknown>;
|
|
6
6
|
registerHook: (this: any, hookType: string, cb: CallableFunction) => void;
|
|
7
|
-
registerFlowChecker: (this: any, cb:
|
|
7
|
+
registerFlowChecker: (this: any, cb: () => unknown) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare const types: {
|
|
10
10
|
define: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConstructorFunction } from '../../types';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
Gaia: ConstructorFunction<
|
|
3
|
+
Gaia: ConstructorFunction<object>;
|
|
4
4
|
Mnemosyne: ConstructorFunction<{
|
|
5
5
|
[x: symbol]: (() => (this: any, uranus: any) => void) | (() => string);
|
|
6
6
|
extract(): (this: any) => {
|
|
@@ -67,16 +67,16 @@ const MnemonicaProtoProps = {
|
|
|
67
67
|
return MNEMONICA;
|
|
68
68
|
},
|
|
69
69
|
exception() {
|
|
70
|
-
const
|
|
70
|
+
const self = this;
|
|
71
71
|
return function (error, ...args) {
|
|
72
72
|
const target = new.target;
|
|
73
|
-
return exceptionConstructor_1.default.call(
|
|
73
|
+
return exceptionConstructor_1.default.call(self, target, error, ...args);
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
sibling() {
|
|
77
|
-
const
|
|
77
|
+
const self = this;
|
|
78
78
|
const siblings = (SiblingTypeName) => {
|
|
79
|
-
const { __collection__: collection, } =
|
|
79
|
+
const { __collection__: collection, } = self;
|
|
80
80
|
const sibling = collection[SiblingTypeName];
|
|
81
81
|
return sibling;
|
|
82
82
|
};
|
|
@@ -11,7 +11,7 @@ declare const TypesUtils: {
|
|
|
11
11
|
getExistentAsyncStack: (existentInstance: any) => any[];
|
|
12
12
|
checkTypeName: (name: string) => void;
|
|
13
13
|
findParentSubType: any;
|
|
14
|
-
makeFakeModificatorType: (TypeName: string, fakeModificator?: TypeModificator<
|
|
14
|
+
makeFakeModificatorType: (TypeName: string, fakeModificator?: TypeModificator<object>) => any;
|
|
15
15
|
reflectPrimitiveWrappers: (_thisArg: any) => any;
|
|
16
16
|
};
|
|
17
17
|
export default TypesUtils;
|
package/build/index.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITypeClass, TypeLookup, IDEF } from './types';
|
|
2
2
|
export type { IDEF } from './types';
|
|
3
3
|
export declare const defaultTypes: any;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type Proto<P, T> = Pick<P, Exclude<keyof P, keyof T>> & T;
|
|
5
|
+
interface IDefinitor<P, IN extends string> {
|
|
6
|
+
<T, M extends Proto<P, T>, S extends Record<IN, new () => unknown> & M>(this: unknown, TypeName: IN, constructHandler: IDEF<T>, proto?: P, config?: object): {
|
|
7
|
+
new (): {
|
|
8
|
+
[key in keyof S]: S[key];
|
|
9
|
+
};
|
|
10
|
+
define: IDefinitor<M, IN>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const define: <T, P extends object, N extends Proto<P, T>, ID extends string, S extends Record<ID, new () => unknown> & N>(this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: P | undefined, config?: {}) => {
|
|
14
|
+
new (): { [key in keyof S]: S[key]; };
|
|
15
|
+
define: IDefinitor<N, ID>;
|
|
16
|
+
};
|
|
17
|
+
export declare const tsdefine: <T>(this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: object, config?: object) => ITypeClass<T>;
|
|
6
18
|
export declare const lookup: TypeLookup;
|
|
7
19
|
export declare const mnemonica: {
|
|
8
20
|
[index: string]: unknown;
|
package/build/index.js
CHANGED
|
@@ -7,14 +7,13 @@ const errorsApi = require("./api/errors");
|
|
|
7
7
|
const descriptors_1 = require("./descriptors");
|
|
8
8
|
exports.defaultTypes = descriptors_1.descriptors.defaultTypes;
|
|
9
9
|
function checkThis(pointer) {
|
|
10
|
-
return pointer === exports.mnemonica ||
|
|
11
|
-
pointer === exports;
|
|
10
|
+
return pointer === exports.mnemonica || pointer === exports;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
exports.define = function (TypeName, constructHandler, proto, config) {
|
|
12
|
+
const define = function (TypeName, constructHandler, proto, config = {}) {
|
|
15
13
|
const types = checkThis(this) ? exports.defaultTypes : this || exports.defaultTypes;
|
|
16
14
|
return types.define(TypeName, constructHandler, proto, config);
|
|
17
15
|
};
|
|
16
|
+
exports.define = define;
|
|
18
17
|
const tsdefine = function (TypeName, constructHandler, proto, config) {
|
|
19
18
|
return exports.defaultTypes.define(TypeName, constructHandler, proto, config);
|
|
20
19
|
};
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export interface ConstructorFunction<ConstructorInstance extends object> {
|
|
2
|
-
new (...args:
|
|
3
|
-
(this: ConstructorInstance, ...args:
|
|
2
|
+
new (...args: unknown[]): ConstructorInstance;
|
|
3
|
+
(this: ConstructorInstance, ...args: unknown[]): ConstructorInstance;
|
|
4
4
|
prototype: ConstructorInstance;
|
|
5
5
|
}
|
|
6
|
-
export type TypeModificator<T extends object> = (...args:
|
|
7
|
-
export type TypeLookup = (this: Map<string,
|
|
6
|
+
export type TypeModificator<T extends object> = (...args: unknown[]) => ConstructorFunction<T>;
|
|
7
|
+
export type TypeLookup = (this: Map<string, unknown>, TypeNestedPath: string) => TypeClass;
|
|
8
8
|
export type TypeClass = {
|
|
9
|
-
new (...args:
|
|
9
|
+
new (...args: unknown[]): unknown;
|
|
10
10
|
define: TypeAbsorber;
|
|
11
11
|
lookup: TypeLookup;
|
|
12
|
-
registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) =>
|
|
12
|
+
registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) => unknown;
|
|
13
13
|
};
|
|
14
|
-
export type TypeAbsorber = (this:
|
|
14
|
+
export type TypeAbsorber = (this: unknown, TypeName: string, constructHandler: CallableFunction, proto?: object, config?: object) => TypeClass;
|
|
15
15
|
export type IDEF<T> = {
|
|
16
|
-
new (
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
new (): T;
|
|
17
|
+
} | {
|
|
18
|
+
(this: T): void;
|
|
19
19
|
};
|
|
20
|
-
export type ITypeAbsorber<T> = (this:
|
|
20
|
+
export type ITypeAbsorber<T> = (this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: object, config?: object) => ITypeClass<T>;
|
|
21
21
|
export interface ITypeClass<T> {
|
|
22
|
-
new (...args:
|
|
23
|
-
(this: T, ...args:
|
|
22
|
+
new (...args: unknown[]): T;
|
|
23
|
+
(this: T, ...args: unknown[]): T;
|
|
24
24
|
define: ITypeAbsorber<T>;
|
|
25
25
|
lookup: TypeLookup;
|
|
26
|
-
registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) =>
|
|
26
|
+
registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) => unknown;
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mnemonica",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.953",
|
|
4
4
|
"description": "abstract technique that aids information retention : instance inheritance system",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -63,28 +63,25 @@
|
|
|
63
63
|
},
|
|
64
64
|
"homepage": "https://github.com/wentout/mnemonica#readme",
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/jest": "^29.5.
|
|
67
|
-
"@types/node": "^18.
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
69
|
-
"@typescript-eslint/parser": "^5.
|
|
66
|
+
"@types/jest": "^29.5.3",
|
|
67
|
+
"@types/node": "^18.17.4",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
69
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
70
70
|
"chai": "^4.3.7",
|
|
71
|
-
"eslint": "^8.
|
|
72
|
-
"eslint-
|
|
73
|
-
"eslint-plugin-import": "^2.27.5",
|
|
71
|
+
"eslint": "^8.46.0",
|
|
72
|
+
"eslint-plugin-import": "^2.28.0",
|
|
74
73
|
"eslint-plugin-mocha": "^10.1.0",
|
|
75
74
|
"eslint-plugin-no-arrow-this": "^1.2.0",
|
|
76
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
77
75
|
"husky": "^8.0.3",
|
|
78
|
-
"jest": "^29.
|
|
76
|
+
"jest": "^29.6.2",
|
|
79
77
|
"json5": "^2.2.3",
|
|
80
|
-
"lint-staged": "^13.2.
|
|
78
|
+
"lint-staged": "^13.2.3",
|
|
81
79
|
"mocha": "^10.2.0",
|
|
82
80
|
"mocha-lcov-reporter": "^1.3.0",
|
|
83
81
|
"nyc": "^15.1.0",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"yaml": "^2.2.2"
|
|
82
|
+
"ts-jest": "^29.1.1",
|
|
83
|
+
"typescript": "^5.1.6",
|
|
84
|
+
"yaml": "^2.3.1"
|
|
88
85
|
},
|
|
89
86
|
"engines": {
|
|
90
87
|
"node": ">=14"
|