epos-unit 1.1.3 → 1.1.5
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/epos-unit.d.ts +3 -3
- package/dist/epos-unit.js +4 -4
- package/package.json +4 -4
- package/src/epos-unit.ts +4 -4
package/dist/epos-unit.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ declare class Unit<TRoot = unknown> {
|
|
|
13
13
|
private [_disposers_];
|
|
14
14
|
[key: PropertyKey]: unknown;
|
|
15
15
|
constructor(parent: Unit<TRoot> | null);
|
|
16
|
-
[epos.state.symbols.
|
|
17
|
-
[epos.state.symbols.
|
|
18
|
-
static get [epos.state.symbols.
|
|
16
|
+
[epos.state.symbols.modelInit](): void;
|
|
17
|
+
[epos.state.symbols.modelCleanup](): void;
|
|
18
|
+
static get [epos.state.symbols.modelVersioner](): unknown;
|
|
19
19
|
static defineVersioner(versioner: Record<number, (this: any, unit: any) => void>): Record<number, (this: any, unit: any) => void>;
|
|
20
20
|
get $(): TRoot;
|
|
21
21
|
up<T extends Unit>(Ancestor: Cls<T>): T | null;
|
package/dist/epos-unit.js
CHANGED
|
@@ -11,7 +11,7 @@ var Unit = class {
|
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
12
|
// INIT
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
|
-
[epos.state.symbols.
|
|
14
|
+
[epos.state.symbols.modelInit]() {
|
|
15
15
|
const Unit2 = this.constructor;
|
|
16
16
|
const descriptors = Object.getOwnPropertyDescriptors(Unit2.prototype);
|
|
17
17
|
const keys = Reflect.ownKeys(descriptors);
|
|
@@ -40,7 +40,7 @@ var Unit = class {
|
|
|
40
40
|
// ---------------------------------------------------------------------------
|
|
41
41
|
// CLEANUP
|
|
42
42
|
// ---------------------------------------------------------------------------
|
|
43
|
-
[epos.state.symbols.
|
|
43
|
+
[epos.state.symbols.modelCleanup]() {
|
|
44
44
|
this[_disposers_].forEach((disposer) => disposer());
|
|
45
45
|
this[_disposers_].clear();
|
|
46
46
|
if (typeof this.cleanup === "function") this.cleanup();
|
|
@@ -48,7 +48,7 @@ var Unit = class {
|
|
|
48
48
|
// ---------------------------------------------------------------------------
|
|
49
49
|
// VERSIONER
|
|
50
50
|
// ---------------------------------------------------------------------------
|
|
51
|
-
static get [epos.state.symbols.
|
|
51
|
+
static get [epos.state.symbols.modelVersioner]() {
|
|
52
52
|
if (!("versioner" in this)) return null;
|
|
53
53
|
return this.versioner;
|
|
54
54
|
}
|
|
@@ -95,7 +95,7 @@ var Unit = class {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
function getParent(child) {
|
|
98
|
-
return child[_parent_] ?? child[epos.state.symbols.
|
|
98
|
+
return child[_parent_] ?? child[epos.state.symbols.parent];
|
|
99
99
|
}
|
|
100
100
|
function findRoot(unit) {
|
|
101
101
|
let root = unit;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epos-unit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
7
7
|
"description": "",
|
|
8
8
|
"keywords": [],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsup src --format esm --dts --clean",
|
|
10
|
+
"build": "tsup src --format esm --dts --clean --no-splitting",
|
|
11
11
|
"lint": "tsc --noEmit",
|
|
12
12
|
"release": "sh -c 'npm version ${1:-patch} && npm run build && npm publish' --"
|
|
13
13
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@eposlabs/utils": "^1.
|
|
28
|
-
"epos": "^1.8.
|
|
27
|
+
"@eposlabs/utils": "^1.2.1",
|
|
28
|
+
"epos": "^1.8.4"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/epos-unit.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Unit<TRoot = unknown> {
|
|
|
24
24
|
// INIT
|
|
25
25
|
// ---------------------------------------------------------------------------
|
|
26
26
|
|
|
27
|
-
[epos.state.symbols.
|
|
27
|
+
[epos.state.symbols.modelInit]() {
|
|
28
28
|
const Unit = this.constructor
|
|
29
29
|
const descriptors: Descriptors = Object.getOwnPropertyDescriptors(Unit.prototype)
|
|
30
30
|
const keys = Reflect.ownKeys(descriptors)
|
|
@@ -65,7 +65,7 @@ export class Unit<TRoot = unknown> {
|
|
|
65
65
|
// CLEANUP
|
|
66
66
|
// ---------------------------------------------------------------------------
|
|
67
67
|
|
|
68
|
-
[epos.state.symbols.
|
|
68
|
+
[epos.state.symbols.modelCleanup]() {
|
|
69
69
|
// Call disposers
|
|
70
70
|
this[_disposers_].forEach(disposer => disposer())
|
|
71
71
|
this[_disposers_].clear()
|
|
@@ -78,7 +78,7 @@ export class Unit<TRoot = unknown> {
|
|
|
78
78
|
// VERSIONER
|
|
79
79
|
// ---------------------------------------------------------------------------
|
|
80
80
|
|
|
81
|
-
static get [epos.state.symbols.
|
|
81
|
+
static get [epos.state.symbols.modelVersioner]() {
|
|
82
82
|
if (!('versioner' in this)) return null
|
|
83
83
|
return this.versioner
|
|
84
84
|
}
|
|
@@ -139,7 +139,7 @@ export class Unit<TRoot = unknown> {
|
|
|
139
139
|
// ---------------------------------------------------------------------------
|
|
140
140
|
|
|
141
141
|
function getParent(child: any) {
|
|
142
|
-
return child[_parent_] ?? child[epos.state.symbols.
|
|
142
|
+
return child[_parent_] ?? child[epos.state.symbols.parent]
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
function findRoot(unit: Unit) {
|