teamplay 0.5.0-alpha.22 → 0.5.0-alpha.24
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.
|
@@ -149,22 +149,6 @@ class SignalCompat extends Signal {
|
|
|
149
149
|
return Signal.prototype.set.call(this, value);
|
|
150
150
|
return setReplaceOnSignal(this, value);
|
|
151
151
|
}
|
|
152
|
-
async add(collectionOrValue, value) {
|
|
153
|
-
const isRoot = this[SEGMENTS].length === 0;
|
|
154
|
-
const isRootCollectionCall = isRoot && typeof collectionOrValue === 'string';
|
|
155
|
-
if (isRootCollectionCall) {
|
|
156
|
-
if (arguments.length !== 2)
|
|
157
|
-
throw Error('Signal.add() expects (collection, object)');
|
|
158
|
-
if (!value || typeof value !== 'object')
|
|
159
|
-
throw Error('Signal.add() expects an object argument');
|
|
160
|
-
const $root = getRoot(this) || this;
|
|
161
|
-
const $collection = resolveSignal($root, [collectionOrValue]);
|
|
162
|
-
return $collection.add(value);
|
|
163
|
-
}
|
|
164
|
-
if (arguments.length > 1)
|
|
165
|
-
throw Error('Signal.add() expects a single argument');
|
|
166
|
-
return Signal.prototype.add.call(this, collectionOrValue);
|
|
167
|
-
}
|
|
168
152
|
async setNull(value) {
|
|
169
153
|
const forwarded = forwardRef(this, 'setNull', arguments);
|
|
170
154
|
if (forwarded)
|
|
@@ -175,21 +159,6 @@ class SignalCompat extends Signal {
|
|
|
175
159
|
return;
|
|
176
160
|
return setReplaceOnSignal(this, value);
|
|
177
161
|
}
|
|
178
|
-
async create(value) {
|
|
179
|
-
const forwarded = forwardRef(this, 'create', arguments);
|
|
180
|
-
if (forwarded)
|
|
181
|
-
return forwarded;
|
|
182
|
-
if (arguments.length > 1)
|
|
183
|
-
throw Error('Signal.create() expects zero or one argument');
|
|
184
|
-
if (arguments.length === 0) {
|
|
185
|
-
value = {};
|
|
186
|
-
}
|
|
187
|
-
ensureCreateTarget(this, 'Signal.create()');
|
|
188
|
-
if (this.get() != null) {
|
|
189
|
-
throw Error(`Signal.create() may only be used on a non-existing document path. Path: ${this.path()}`);
|
|
190
|
-
}
|
|
191
|
-
return setReplaceOnSignal(this, value);
|
|
192
|
-
}
|
|
193
162
|
async setDiffDeep(value) {
|
|
194
163
|
const forwarded = forwardRef(this, 'setDiffDeep', arguments);
|
|
195
164
|
if (forwarded)
|
|
@@ -972,15 +941,6 @@ function ensureValueTarget($signal) {
|
|
|
972
941
|
throw Error('Mutators can\'t be used on a query signal');
|
|
973
942
|
return segments;
|
|
974
943
|
}
|
|
975
|
-
function ensureCreateTarget($signal, methodName) {
|
|
976
|
-
const segments = $signal[SEGMENTS];
|
|
977
|
-
if ($signal[IS_QUERY])
|
|
978
|
-
throw Error(`${methodName} can't be used on a query signal`);
|
|
979
|
-
if (segments.length !== 2) {
|
|
980
|
-
throw Error(`${methodName} may only be used on a document path`);
|
|
981
|
-
}
|
|
982
|
-
return segments;
|
|
983
|
-
}
|
|
984
944
|
async function arrayPushOnSignal($signal, value) {
|
|
985
945
|
const segments = ensureArrayTarget($signal);
|
|
986
946
|
const idFields = getIdFieldsForSegments(segments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.24",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
136
|
"license": "MIT",
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "cdb8848af9b1f3ecc77e990a3fbc4d55d4aa0dec"
|
|
138
138
|
}
|