mnemonica 0.9.93 → 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.
Files changed (53) hide show
  1. package/README.md +40 -13
  2. package/build/api/errors/bindedMethodErrorHandler.js +52 -51
  3. package/build/api/errors/exceptionConstructor.js +98 -98
  4. package/build/api/errors/index.d.ts +1 -1
  5. package/build/api/errors/index.js +51 -48
  6. package/build/api/errors/throwModificationError.js +96 -95
  7. package/build/api/hooks/flowCheckers.d.ts +1 -1
  8. package/build/api/hooks/flowCheckers.js +11 -10
  9. package/build/api/hooks/index.js +7 -7
  10. package/build/api/hooks/invokeHook.js +46 -45
  11. package/build/api/hooks/registerHook.js +19 -18
  12. package/build/api/index.d.ts +1 -1
  13. package/build/api/index.js +9 -9
  14. package/build/api/types/InstanceCreator.d.ts +2 -4
  15. package/build/api/types/InstanceCreator.js +237 -239
  16. package/build/api/types/InstanceModificator.js +10 -8
  17. package/build/api/types/Mnemosyne.d.ts +3 -2
  18. package/build/api/types/Mnemosyne.js +127 -111
  19. package/build/api/types/TypeProxy.js +132 -132
  20. package/build/api/types/addProps.d.ts +1 -0
  21. package/build/api/types/addProps.js +68 -0
  22. package/build/api/types/compileNewModificatorFunctionBody.d.ts +1 -1
  23. package/build/api/types/compileNewModificatorFunctionBody.js +37 -27
  24. package/build/api/types/createInstanceModificator.js +26 -24
  25. package/build/api/types/createInstanceModificator200XthWay.js +29 -28
  26. package/build/api/types/index.js +161 -159
  27. package/build/api/types/obeyConstructor.d.ts +1 -0
  28. package/build/api/types/obeyConstructor.js +30 -0
  29. package/build/api/utils/index.d.ts +20 -8
  30. package/build/api/utils/index.js +122 -122
  31. package/build/constants/index.d.ts +2 -0
  32. package/build/constants/index.js +62 -57
  33. package/build/descriptors/errors/index.js +7 -7
  34. package/build/descriptors/index.js +5 -5
  35. package/build/descriptors/namespaces/index.js +70 -70
  36. package/build/descriptors/types/index.js +141 -141
  37. package/build/index.d.ts +39 -5
  38. package/build/index.js +63 -31
  39. package/build/types/index.d.ts +16 -17
  40. package/build/types/index.js +1 -1
  41. package/build/utils/collectConstructors.js +52 -51
  42. package/build/utils/defineStackCleaner.js +9 -8
  43. package/build/utils/extract.js +16 -15
  44. package/build/utils/hop.js +3 -2
  45. package/build/utils/index.js +27 -27
  46. package/build/utils/merge.js +15 -14
  47. package/build/utils/parent.js +17 -16
  48. package/build/utils/parse.js +42 -41
  49. package/build/utils/pick.js +21 -20
  50. package/build/utils/toJSON.js +27 -26
  51. package/package.json +92 -92
  52. package/build/api/types/InstanceCreatorProto.d.ts +0 -3
  53. package/build/api/types/InstanceCreatorProto.js +0 -88
@@ -1,88 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value : true });
3
- exports.proceedProto = exports.undefineParentSubTypes = exports.addProps = void 0;
4
- const constants_1 = require('../../constants');
5
- const { odp, } = constants_1.constants;
6
- exports.addProps = function () {
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
- };
65
- exports.undefineParentSubTypes = function () {
66
- const self = this;
67
- const { __proto_proto__: proto, existentInstance: { __subtypes__: subtypes } } = self;
68
- if (!subtypes) {
69
- return;
70
- }
71
- const unscopables = {};
72
- [...subtypes.keys()].forEach((name) => {
73
- odp(proto, name, {
74
- get () {
75
- return undefined;
76
- }
77
- });
78
- unscopables[name] = true;
79
- });
80
- proto[Symbol.unscopables] = unscopables;
81
- };
82
- exports.proceedProto = function () {
83
- const self = this;
84
- self.addProps();
85
- if (self.type.isSubType && self.config.strictChain) {
86
- self.undefineParentSubTypes();
87
- }
88
- };