@mat3ra/mode 2025.11.6-0 → 2025.11.6-1
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/dist/js/model.js +5 -2
- package/package.json +1 -1
- package/src/js/model.ts +5 -2
package/dist/js/model.js
CHANGED
|
@@ -14,10 +14,13 @@ const tree_1 = require("./tree");
|
|
|
14
14
|
const EMPTY_BRANCH = { methods: {} };
|
|
15
15
|
class Model extends entity_1.InMemoryEntity {
|
|
16
16
|
constructor(config) {
|
|
17
|
-
const { application, ...entityConfig } = config;
|
|
17
|
+
const { application, method = method_1.Method.defaultConfig, ...entityConfig } = config;
|
|
18
18
|
super(entityConfig);
|
|
19
19
|
this._application = application;
|
|
20
20
|
this._MethodFactory = factory_1.MethodFactory;
|
|
21
|
+
if (method) {
|
|
22
|
+
this.setProp("method", method);
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
setSubtype(subtype) {
|
|
23
26
|
this.setProp("subtype", subtype);
|
|
@@ -65,7 +68,7 @@ class Model extends entity_1.InMemoryEntity {
|
|
|
65
68
|
}
|
|
66
69
|
get Method() {
|
|
67
70
|
if (!this._method) {
|
|
68
|
-
this._method = this._MethodFactory.create(this.method
|
|
71
|
+
this._method = this._MethodFactory.create(this.method);
|
|
69
72
|
}
|
|
70
73
|
return this._method;
|
|
71
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mat3ra/mode",
|
|
3
|
-
"version": "2025.11.6-
|
|
3
|
+
"version": "2025.11.6-1",
|
|
4
4
|
"description": "MOdel and method DEfinitions",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "nyc --reporter=text mocha --extension ts --recursive --bail --require ts-node/register/transpile-only \"tests/**/*.test.ts\"",
|
package/src/js/model.ts
CHANGED
|
@@ -28,10 +28,13 @@ export class Model extends (InMemoryEntity as Base) implements BaseModel {
|
|
|
28
28
|
protected _method?: Method;
|
|
29
29
|
|
|
30
30
|
constructor(config: ModelConfig) {
|
|
31
|
-
const { application, ...entityConfig } = config;
|
|
31
|
+
const { application, method = Method.defaultConfig, ...entityConfig } = config;
|
|
32
32
|
super(entityConfig);
|
|
33
33
|
this._application = application as ApplicationSchemaBase | undefined;
|
|
34
34
|
this._MethodFactory = MethodFactory;
|
|
35
|
+
if (method) {
|
|
36
|
+
this.setProp("method", method);
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
setSubtype(subtype: SlugifiedEntryOrSlug): void {
|
|
@@ -85,7 +88,7 @@ export class Model extends (InMemoryEntity as Base) implements BaseModel {
|
|
|
85
88
|
|
|
86
89
|
get Method(): Method {
|
|
87
90
|
if (!this._method) {
|
|
88
|
-
this._method = this._MethodFactory.create(this.method
|
|
91
|
+
this._method = this._MethodFactory.create(this.method);
|
|
89
92
|
}
|
|
90
93
|
return this._method;
|
|
91
94
|
}
|