teamplay 0.4.0-alpha.91 → 0.4.0-alpha.92
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/privateData.js +11 -0
- package/package.json +2 -2
package/orm/privateData.js
CHANGED
|
@@ -37,6 +37,7 @@ export function setPrivateData (rootId, logicalSegments, value) {
|
|
|
37
37
|
throw Error('setPrivateData expects private collection segments')
|
|
38
38
|
}
|
|
39
39
|
const context = getRootContext(rootId, true)
|
|
40
|
+
if (!context) return
|
|
40
41
|
const segments = getPrivateDataSegments(logicalSegments)
|
|
41
42
|
_set(segments, value, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
42
43
|
}
|
|
@@ -46,6 +47,7 @@ export function setReplacePrivateData (rootId, logicalSegments, value) {
|
|
|
46
47
|
throw Error('setReplacePrivateData expects private collection segments')
|
|
47
48
|
}
|
|
48
49
|
const context = getRootContext(rootId, true)
|
|
50
|
+
if (!context) return
|
|
49
51
|
const segments = getPrivateDataSegments(logicalSegments)
|
|
50
52
|
_setReplace(segments, value, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
51
53
|
}
|
|
@@ -61,46 +63,55 @@ export function delPrivateData (rootId, logicalSegments, options = {}) {
|
|
|
61
63
|
|
|
62
64
|
export function arrayPushPrivateData (rootId, logicalSegments, value) {
|
|
63
65
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayPushPrivateData')
|
|
66
|
+
if (!context) return
|
|
64
67
|
return _arrayPush(getPrivateDataSegments(logicalSegments), value, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
export function arrayUnshiftPrivateData (rootId, logicalSegments, value) {
|
|
68
71
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayUnshiftPrivateData')
|
|
72
|
+
if (!context) return
|
|
69
73
|
return _arrayUnshift(getPrivateDataSegments(logicalSegments), value, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
export function arrayInsertPrivateData (rootId, logicalSegments, index, values) {
|
|
73
77
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayInsertPrivateData')
|
|
78
|
+
if (!context) return
|
|
74
79
|
return _arrayInsert(getPrivateDataSegments(logicalSegments), index, values, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
export function arrayPopPrivateData (rootId, logicalSegments) {
|
|
78
83
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayPopPrivateData')
|
|
84
|
+
if (!context) return
|
|
79
85
|
return _arrayPop(getPrivateDataSegments(logicalSegments), context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
export function arrayShiftPrivateData (rootId, logicalSegments) {
|
|
83
89
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayShiftPrivateData')
|
|
90
|
+
if (!context) return
|
|
84
91
|
return _arrayShift(getPrivateDataSegments(logicalSegments), context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
export function arrayRemovePrivateData (rootId, logicalSegments, index, howMany = 1) {
|
|
88
95
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayRemovePrivateData')
|
|
96
|
+
if (!context) return
|
|
89
97
|
return _arrayRemove(getPrivateDataSegments(logicalSegments), index, howMany, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
90
98
|
}
|
|
91
99
|
|
|
92
100
|
export function arrayMovePrivateData (rootId, logicalSegments, from, to, howMany = 1) {
|
|
93
101
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'arrayMovePrivateData')
|
|
102
|
+
if (!context) return
|
|
94
103
|
return _arrayMove(getPrivateDataSegments(logicalSegments), from, to, howMany, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
export function stringInsertPrivateData (rootId, logicalSegments, index, text) {
|
|
98
107
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'stringInsertPrivateData')
|
|
108
|
+
if (!context) return
|
|
99
109
|
return _stringInsertLocal(getPrivateDataSegments(logicalSegments), index, text, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
100
110
|
}
|
|
101
111
|
|
|
102
112
|
export function stringRemovePrivateData (rootId, logicalSegments, index, howMany) {
|
|
103
113
|
const context = getRequiredPrivateContext(rootId, logicalSegments, 'stringRemovePrivateData')
|
|
114
|
+
if (!context) return
|
|
104
115
|
return _stringRemoveLocal(getPrivateDataSegments(logicalSegments), index, howMany, context.getPrivateDataRoot(), getModelEventContext(rootId, logicalSegments))
|
|
105
116
|
}
|
|
106
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.92",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
"license": "MIT",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "d55bd0417f7611c11584ae6400e5e111cc0ec9e3"
|
|
87
87
|
}
|