mnemonica 0.9.94 → 0.9.98
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/README.md +40 -13
- package/build/api/errors/bindedMethodErrorHandler.js +50 -50
- package/build/api/errors/exceptionConstructor.js +98 -98
- package/build/api/errors/index.d.ts +1 -1
- package/build/api/errors/index.js +45 -45
- package/build/api/errors/throwModificationError.js +94 -94
- package/build/api/hooks/flowCheckers.d.ts +1 -1
- package/build/api/hooks/flowCheckers.js +9 -9
- package/build/api/hooks/index.js +7 -7
- package/build/api/hooks/invokeHook.js +44 -44
- package/build/api/hooks/registerHook.js +17 -17
- package/build/api/index.d.ts +1 -1
- package/build/api/index.js +9 -9
- package/build/api/types/InstanceCreator.d.ts +1 -1
- package/build/api/types/InstanceCreator.js +237 -237
- package/build/api/types/InstanceModificator.js +8 -8
- package/build/api/types/Mnemosyne.d.ts +2 -2
- package/build/api/types/Mnemosyne.js +127 -127
- package/build/api/types/TypeProxy.js +132 -132
- package/build/api/types/addProps.js +60 -60
- package/build/api/types/compileNewModificatorFunctionBody.d.ts +1 -1
- package/build/api/types/compileNewModificatorFunctionBody.js +37 -27
- package/build/api/types/createInstanceModificator.js +26 -27
- package/build/api/types/createInstanceModificator200XthWay.js +29 -30
- package/build/api/types/index.js +157 -157
- package/build/api/types/obeyConstructor.js +23 -23
- package/build/api/utils/index.d.ts +20 -8
- package/build/api/utils/index.js +122 -122
- package/build/constants/index.js +61 -61
- package/build/descriptors/errors/index.js +7 -7
- package/build/descriptors/index.js +5 -5
- package/build/descriptors/namespaces/index.js +70 -70
- package/build/descriptors/types/index.js +141 -141
- package/build/index.d.ts +39 -5
- package/build/index.js +63 -32
- package/build/types/index.d.ts +16 -17
- package/build/types/index.js +1 -1
- package/build/utils/collectConstructors.js +50 -50
- package/build/utils/defineStackCleaner.js +7 -7
- package/build/utils/extract.js +14 -14
- package/build/utils/hop.js +1 -1
- package/build/utils/index.js +27 -27
- package/build/utils/merge.js +13 -13
- package/build/utils/parent.js +15 -15
- package/build/utils/parse.js +40 -40
- package/build/utils/pick.js +19 -19
- package/build/utils/toJSON.js +25 -25
- package/package.json +92 -92
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProps = void 0;
|
|
4
|
-
const constants_1 = require(
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
5
|
const { odp, } = constants_1.constants;
|
|
6
6
|
const addProps = function () {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
7
|
+
const self = this;
|
|
8
|
+
const { type, existentInstance, args, config: { submitStack }, __proto_proto__: proto } = self;
|
|
9
|
+
const { namespace, collection, subtypes, } = type;
|
|
10
|
+
odp(proto, '__proto_proto__', {
|
|
11
|
+
get() {
|
|
12
|
+
return proto;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
odp(proto, '__args__', {
|
|
16
|
+
get() {
|
|
17
|
+
return args;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
odp(proto, '__collection__', {
|
|
21
|
+
get() {
|
|
22
|
+
return collection;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
odp(proto, '__namespace__', {
|
|
26
|
+
get() {
|
|
27
|
+
return namespace;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
odp(proto, '__subtypes__', {
|
|
31
|
+
get() {
|
|
32
|
+
return subtypes;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
odp(proto, '__type__', {
|
|
36
|
+
get() {
|
|
37
|
+
return type;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
odp(proto, '__parent__', {
|
|
41
|
+
get() {
|
|
42
|
+
return existentInstance;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
if (submitStack) {
|
|
46
|
+
const { stack } = this;
|
|
47
|
+
odp(proto, '__stack__', {
|
|
48
|
+
get() {
|
|
49
|
+
return stack.join('\n');
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
odp(proto, '__creator__', {
|
|
54
|
+
get() {
|
|
55
|
+
return self;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const timestamp = Date.now();
|
|
59
|
+
odp(proto, '__timestamp__', {
|
|
60
|
+
get() {
|
|
61
|
+
return timestamp;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
64
|
};
|
|
65
65
|
exports.addProps = addProps;
|
|
66
66
|
module.exports = {
|
|
67
|
-
|
|
67
|
+
addProps: exports.addProps
|
|
68
68
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const compileNewModificatorFunctionBody: (FunctionName: string, asClass?: boolean) =>
|
|
1
|
+
declare const compileNewModificatorFunctionBody: (FunctionName: string, asClass?: boolean) => (ConstructHandler: any, CreationHandler: any, SymbolConstructorName: symbol) => any;
|
|
2
2
|
export default compileNewModificatorFunctionBody;
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getClassConstructor = (ConstructHandler, CreationHandler) => {
|
|
4
|
+
return class extends ConstructHandler {
|
|
5
|
+
constructor(...args) {
|
|
6
|
+
const answer = super(...args);
|
|
7
|
+
return CreationHandler.call(this, answer);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const getFunctionConstructor = (ConstructHandler, CreationHandler) => {
|
|
12
|
+
return function (...args) {
|
|
13
|
+
const answer = ConstructHandler.call(this, ...args);
|
|
14
|
+
return CreationHandler.call(this, answer);
|
|
15
|
+
};
|
|
16
|
+
};
|
|
3
17
|
const compileNewModificatorFunctionBody = function (FunctionName, asClass = false) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return ${FunctionName};
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
`);
|
|
18
|
+
return function (ConstructHandler, CreationHandler, SymbolConstructorName) {
|
|
19
|
+
return function () {
|
|
20
|
+
let ModificationBody;
|
|
21
|
+
if (asClass) {
|
|
22
|
+
ModificationBody = getClassConstructor(ConstructHandler, CreationHandler);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
ModificationBody = getFunctionConstructor(ConstructHandler, CreationHandler);
|
|
26
|
+
}
|
|
27
|
+
ModificationBody.prototype.constructor = ModificationBody;
|
|
28
|
+
Object.defineProperty(ModificationBody.prototype.constructor, 'name', {
|
|
29
|
+
value: FunctionName,
|
|
30
|
+
writable: false
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(ModificationBody, SymbolConstructorName, {
|
|
33
|
+
get() {
|
|
34
|
+
return FunctionName;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return ModificationBody;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
30
40
|
};
|
|
31
41
|
exports.default = compileNewModificatorFunctionBody;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const obeyConstructor_1 = require(
|
|
4
|
-
function default_1
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const obeyConstructor_1 = require("./obeyConstructor");
|
|
4
|
+
function default_1() {
|
|
5
|
+
const CreateInstanceModificator = function (ModificatorType, ModificatorTypePrototype, addProps) {
|
|
6
|
+
const existentInstance = this;
|
|
7
|
+
const Mnemosyne = {};
|
|
8
|
+
Reflect.setPrototypeOf(Mnemosyne, existentInstance);
|
|
9
|
+
addProps(Mnemosyne);
|
|
10
|
+
Object.defineProperty(Mnemosyne, 'constructor', {
|
|
11
|
+
get() {
|
|
12
|
+
return ModificatorType;
|
|
13
|
+
},
|
|
14
|
+
enumerable: false
|
|
15
|
+
});
|
|
16
|
+
Object.entries(ModificatorTypePrototype).forEach((entry) => {
|
|
17
|
+
const [name, value] = entry;
|
|
18
|
+
if (name !== 'constructor') {
|
|
19
|
+
(ModificatorType.prototype[name] = value);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
ModificatorType.prototype.constructor = ModificatorType;
|
|
23
|
+
Reflect.setPrototypeOf(ModificatorType.prototype, Mnemosyne);
|
|
24
|
+
(0, obeyConstructor_1.obey)(existentInstance, ModificatorType);
|
|
25
|
+
return ModificatorType;
|
|
26
|
+
};
|
|
27
|
+
return CreateInstanceModificator;
|
|
28
28
|
}
|
|
29
29
|
exports.default = default_1;
|
|
30
|
-
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const obeyConstructor_1 = require(
|
|
4
|
-
function default_1
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const obeyConstructor_1 = require("./obeyConstructor");
|
|
4
|
+
function default_1() {
|
|
5
|
+
const CreateInstanceModificatorAncient200XthWay = function (ModificatorType, ModificatorTypePrototype, addProps) {
|
|
6
|
+
const existentInstance = this;
|
|
7
|
+
const TripleSchemeClosure = function () {
|
|
8
|
+
const Mnemosyne = this;
|
|
9
|
+
addProps(Mnemosyne);
|
|
10
|
+
const Inherico = function () {
|
|
11
|
+
const moreInherited = this;
|
|
12
|
+
ModificatorType.prototype = moreInherited;
|
|
13
|
+
Object.assign(ModificatorType.prototype, ModificatorTypePrototype);
|
|
14
|
+
Object.defineProperty(ModificatorType.prototype, 'constructor', {
|
|
15
|
+
get() {
|
|
16
|
+
return ModificatorType;
|
|
17
|
+
},
|
|
18
|
+
enumerable: false
|
|
19
|
+
});
|
|
20
|
+
(0, obeyConstructor_1.obey)(existentInstance, ModificatorType);
|
|
21
|
+
return ModificatorType;
|
|
22
|
+
};
|
|
23
|
+
Inherico.prototype = Mnemosyne;
|
|
24
|
+
Inherico.prototype.constructor = ModificatorType;
|
|
25
|
+
return new Inherico();
|
|
26
|
+
};
|
|
27
|
+
TripleSchemeClosure.prototype = existentInstance;
|
|
28
|
+
return new TripleSchemeClosure();
|
|
29
|
+
};
|
|
30
|
+
return CreateInstanceModificatorAncient200XthWay;
|
|
31
31
|
}
|
|
32
32
|
exports.default = default_1;
|
|
33
|
-
|