teamplay 0.1.7 → 0.1.9
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/orm/Signal.js +7 -1
- package/package.json +9 -10
- package/utils/uuid.cjs +0 -2
package/orm/Signal.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
* 3. If extremely late bindings are enabled, to prevent name collisions when accessing fields
|
|
12
12
|
* in the raw data tree which have the same name as signal's methods
|
|
13
13
|
*/
|
|
14
|
+
import uuid from '@teamplay/utils/uuid'
|
|
14
15
|
import { get as _get, set as _set, del as _del, setPublicDoc as _setPublicDoc } from './dataTree.js'
|
|
15
16
|
import getSignal, { rawSignal } from './getSignal.js'
|
|
16
17
|
import { IS_QUERY, HASH, QUERIES } from './Query.js'
|
|
17
18
|
import { ROOT_FUNCTION, getRoot } from './Root.js'
|
|
18
|
-
import uuid from '../utils/uuid.cjs'
|
|
19
19
|
|
|
20
20
|
export const SEGMENTS = Symbol('path segments targeting the particular node in the data tree')
|
|
21
21
|
|
|
@@ -44,6 +44,12 @@ export default class Signal extends Function {
|
|
|
44
44
|
return _get(this[SEGMENTS])
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
getId () {
|
|
48
|
+
if (this[SEGMENTS].length === 0) throw Error('Can\'t get the id of the root signal')
|
|
49
|
+
if (this[SEGMENTS].length === 1) throw Error('Can\'t get the id of a collection')
|
|
50
|
+
return this[SEGMENTS][this[SEGMENTS].length - 1]
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
* [Symbol.iterator] () {
|
|
48
54
|
if (this[IS_QUERY]) {
|
|
49
55
|
const ids = _get([QUERIES, this[HASH], 'ids'])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,18 +23,17 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@nx-js/observer-util": "^4.1.3",
|
|
26
|
-
"@teamplay/backend": "^0.1.
|
|
27
|
-
"@teamplay/cache": "^0.1.
|
|
28
|
-
"@teamplay/channel": "^0.1.
|
|
29
|
-
"@teamplay/debug": "^0.1.
|
|
30
|
-
"@teamplay/schema": "^0.1.
|
|
31
|
-
"@teamplay/utils": "^0.1.
|
|
26
|
+
"@teamplay/backend": "^0.1.9",
|
|
27
|
+
"@teamplay/cache": "^0.1.9",
|
|
28
|
+
"@teamplay/channel": "^0.1.9",
|
|
29
|
+
"@teamplay/debug": "^0.1.9",
|
|
30
|
+
"@teamplay/schema": "^0.1.9",
|
|
31
|
+
"@teamplay/utils": "^0.1.9",
|
|
32
32
|
"diff-match-patch": "^1.0.5",
|
|
33
33
|
"events": "^3.3.0",
|
|
34
34
|
"json0-ot-diff": "^1.1.2",
|
|
35
35
|
"lodash": "^4.17.20",
|
|
36
|
-
"sharedb": "^5.0.0"
|
|
37
|
-
"uuid": "^3.4.0"
|
|
36
|
+
"sharedb": "^5.0.0"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@jest/globals": "^29.7.0",
|
|
@@ -64,5 +63,5 @@
|
|
|
64
63
|
]
|
|
65
64
|
},
|
|
66
65
|
"license": "MIT",
|
|
67
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "e6a092cd5d261ac516d96b7fbd6c7087e40c4398"
|
|
68
67
|
}
|
package/utils/uuid.cjs
DELETED