mnemonica 0.9.990 → 0.9.992
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 +7 -117
- package/build/api/errors/throwModificationError.js +4 -4
- package/build/api/errors/throwModificationError.js.map +1 -1
- package/build/api/hooks/invokeHook.js.map +1 -1
- package/build/api/types/InstanceCreator.d.ts +1 -2
- package/build/api/types/InstanceCreator.js +10 -13
- package/build/api/types/InstanceCreator.js.map +1 -1
- package/build/api/types/Mnemosyne.js +8 -6
- package/build/api/types/Mnemosyne.js.map +1 -1
- package/build/api/types/TypeProxy.js +4 -5
- package/build/api/types/TypeProxy.js.map +1 -1
- package/build/api/types/addProps.js +1 -6
- package/build/api/types/addProps.js.map +1 -1
- package/build/api/types/createInstanceModificator.d.ts +2 -2
- package/build/api/types/createInstanceModificator.js.map +1 -1
- package/build/api/types/index.js +3 -5
- package/build/api/types/index.js.map +1 -1
- package/build/api/utils/index.d.ts +1 -1
- package/build/api/utils/index.js +5 -5
- package/build/api/utils/index.js.map +1 -1
- package/build/constants/index.d.ts +4 -5
- package/build/constants/index.js +30 -12
- package/build/constants/index.js.map +1 -1
- package/build/descriptors/index.d.ts +7 -1
- package/build/descriptors/index.js +1 -2
- package/build/descriptors/index.js.map +1 -1
- package/build/descriptors/types/index.d.ts +1 -1
- package/build/descriptors/types/index.js +33 -56
- package/build/descriptors/types/index.js.map +1 -1
- package/build/index.d.ts +6 -33
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/types/index.d.ts +36 -2
- package/build/utils/parse.js.map +1 -1
- package/package.json +10 -9
- package/build/descriptors/namespaces/index.d.ts +0 -1
- package/build/descriptors/namespaces/index.js +0 -93
- package/build/descriptors/namespaces/index.js.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.namespaces = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
const { odp, MNEMONICA, SymbolDefaultNamespace, SymbolConfig, } = constants_1.constants;
|
|
6
|
-
const errors_1 = require("../../descriptors/errors");
|
|
7
|
-
const { OPTIONS_ERROR, } = errors_1.ErrorsTypes;
|
|
8
|
-
const hooksAPI = require("../../api/hooks");
|
|
9
|
-
const __1 = require("../");
|
|
10
|
-
const createInstanceModificator_1 = require("../../api/types/createInstanceModificator");
|
|
11
|
-
const defaultOptions = {
|
|
12
|
-
ModificationConstructor: createInstanceModificator_1.default,
|
|
13
|
-
strictChain: true,
|
|
14
|
-
blockErrors: true,
|
|
15
|
-
submitStack: false,
|
|
16
|
-
awaitReturn: true,
|
|
17
|
-
};
|
|
18
|
-
const namespaceStorage = new Map();
|
|
19
|
-
const Namespace = function (name, config) {
|
|
20
|
-
if (typeof config === 'string') {
|
|
21
|
-
config = {
|
|
22
|
-
description: config
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if (!(config instanceof Object)) {
|
|
26
|
-
throw new OPTIONS_ERROR;
|
|
27
|
-
}
|
|
28
|
-
const typesCollections = new Map();
|
|
29
|
-
config = Object.assign({}, defaultOptions, config);
|
|
30
|
-
odp(this, SymbolConfig, {
|
|
31
|
-
get() {
|
|
32
|
-
return config;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
odp(this, 'name', {
|
|
36
|
-
get() {
|
|
37
|
-
return name;
|
|
38
|
-
},
|
|
39
|
-
enumerable: true
|
|
40
|
-
});
|
|
41
|
-
odp(this, 'typesCollections', {
|
|
42
|
-
get() {
|
|
43
|
-
return typesCollections;
|
|
44
|
-
},
|
|
45
|
-
enumerable: true
|
|
46
|
-
});
|
|
47
|
-
const hooks = Object.create(null);
|
|
48
|
-
odp(this, 'hooks', {
|
|
49
|
-
get() {
|
|
50
|
-
return hooks;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
namespaceStorage.set(name, this);
|
|
54
|
-
};
|
|
55
|
-
Namespace.prototype = Object.assign({ createTypesCollection(association, config) {
|
|
56
|
-
const { createTypesCollection } = __1.descriptors;
|
|
57
|
-
return createTypesCollection(this, association, config);
|
|
58
|
-
} }, hooksAPI);
|
|
59
|
-
const DEFAULT_NAMESPACE = new Namespace(SymbolDefaultNamespace, {
|
|
60
|
-
description: `default ${MNEMONICA} namespace`
|
|
61
|
-
});
|
|
62
|
-
exports.namespaces = Object.create(null);
|
|
63
|
-
odp(exports.namespaces, 'createNamespace', {
|
|
64
|
-
get() {
|
|
65
|
-
return (name, config = {}) => {
|
|
66
|
-
return new Namespace(name, config);
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
enumerable: true
|
|
70
|
-
});
|
|
71
|
-
odp(exports.namespaces, 'namespaces', {
|
|
72
|
-
get() {
|
|
73
|
-
return namespaceStorage;
|
|
74
|
-
},
|
|
75
|
-
enumerable: true
|
|
76
|
-
});
|
|
77
|
-
odp(exports.namespaces, 'defaultNamespace', {
|
|
78
|
-
get() {
|
|
79
|
-
return DEFAULT_NAMESPACE;
|
|
80
|
-
},
|
|
81
|
-
enumerable: true
|
|
82
|
-
});
|
|
83
|
-
odp(exports.namespaces, SymbolDefaultNamespace, {
|
|
84
|
-
get() {
|
|
85
|
-
return DEFAULT_NAMESPACE;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
odp(exports.namespaces, 'defaultOptionsKeys', {
|
|
89
|
-
get() {
|
|
90
|
-
return Object.keys(defaultOptions);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/descriptors/namespaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAOb,+CAA4C;AAC5C,MAAM,EACL,GAAG,EACH,SAAS,EACT,sBAAsB,EACtB,YAAY,GACZ,GAAG,qBAAS,CAAC;AAEd,qDAAuD;AACvD,MAAM,EACL,aAAa,GACb,GAAG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