@signalium/query 1.0.14 → 1.0.16
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/CHANGELOG.md +13 -0
- package/dist/cjs/development/index.js +11 -2
- package/dist/cjs/development/index.js.map +1 -1
- package/dist/cjs/production/index.js +11 -2
- package/dist/cjs/production/index.js.map +1 -1
- package/dist/esm/development/index.js +11 -2
- package/dist/esm/development/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/production/index.js +11 -2
- package/dist/esm/production/index.js.map +1 -1
- package/dist/esm/proxy.d.ts +4 -2
- package/dist/esm/proxy.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @signalium/query
|
|
2
2
|
|
|
3
|
+
## 1.0.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4a3bc06: Fix union parseValue check
|
|
8
|
+
|
|
9
|
+
## 1.0.15
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a95ed74: Ensure entities have a unique prototype
|
|
14
|
+
- aa50869: Fix Record parsing and reorganize/expand parsing tests
|
|
15
|
+
|
|
3
16
|
## 1.0.14
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -303,7 +303,7 @@ function defineUnion(...types) {
|
|
|
303
303
|
return new ValidatorDef(2, mask | Mask.UNION, void 0, values);
|
|
304
304
|
}
|
|
305
305
|
if (shape === void 0) {
|
|
306
|
-
return ValidatorDef.cloneWith(definition, mask
|
|
306
|
+
return ValidatorDef.cloneWith(definition, mask, values);
|
|
307
307
|
}
|
|
308
308
|
return new ValidatorDef(1, mask | Mask.UNION, shape, values);
|
|
309
309
|
}
|
|
@@ -700,6 +700,8 @@ const noopWarn = () => {
|
|
|
700
700
|
const entries$1 = Object.entries;
|
|
701
701
|
const isArray = Array.isArray;
|
|
702
702
|
const PROXY_ID = /* @__PURE__ */ new WeakMap();
|
|
703
|
+
class Entity {
|
|
704
|
+
}
|
|
703
705
|
function parseUnionValue(valueType, value, unionDef, path, warn = noopWarn) {
|
|
704
706
|
if (valueType === Mask.ARRAY) {
|
|
705
707
|
const shape = unionDef.shape[ARRAY_KEY];
|
|
@@ -844,7 +846,7 @@ function parseValue(value, propDef, path, skipFallbacks = false, warn = noopWarn
|
|
|
844
846
|
}
|
|
845
847
|
return value;
|
|
846
848
|
}
|
|
847
|
-
if ((
|
|
849
|
+
if ((propMask & Mask.UNION) !== 0) {
|
|
848
850
|
return parseUnionValue(
|
|
849
851
|
valueType,
|
|
850
852
|
value,
|
|
@@ -856,6 +858,9 @@ function parseValue(value, propDef, path, skipFallbacks = false, warn = noopWarn
|
|
|
856
858
|
if (valueType === Mask.ARRAY) {
|
|
857
859
|
return parseArrayValue(value, propDef.shape, path, warn);
|
|
858
860
|
}
|
|
861
|
+
if ((propMask & Mask.RECORD) !== 0) {
|
|
862
|
+
return parseRecordValue(value, propDef.shape, path, warn);
|
|
863
|
+
}
|
|
859
864
|
return parseObjectValue(value, propDef, path, warn);
|
|
860
865
|
}
|
|
861
866
|
}
|
|
@@ -881,6 +886,9 @@ function createEntityProxy(id, entityRecord, def, entityRelay, scopeOwner, warn
|
|
|
881
886
|
});
|
|
882
887
|
let proxy;
|
|
883
888
|
const handler = {
|
|
889
|
+
getPrototypeOf() {
|
|
890
|
+
return Entity.prototype;
|
|
891
|
+
},
|
|
884
892
|
get(target, prop) {
|
|
885
893
|
if (prop === "toJSON") {
|
|
886
894
|
return toJSON;
|
|
@@ -2958,6 +2966,7 @@ function mutation(mutationDefinitionBuilder) {
|
|
|
2958
2966
|
return buildMutationFn(mutationDefinitionBuilder);
|
|
2959
2967
|
}
|
|
2960
2968
|
exports.ARRAY_KEY = ARRAY_KEY;
|
|
2969
|
+
exports.Entity = Entity;
|
|
2961
2970
|
exports.Mask = Mask;
|
|
2962
2971
|
exports.MemoryEvictionManager = MemoryEvictionManager;
|
|
2963
2972
|
exports.NetworkManager = NetworkManager;
|