@dcl/ecs 7.27.1-33755014733.commit-cb87612 → 7.27.1-33755622021.commit-da82bfb
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/schemas/Optional.js
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
export const IOptional = (spec) => {
|
|
5
5
|
return {
|
|
6
6
|
serialize(value, builder) {
|
|
7
|
-
|
|
7
|
+
// Only the absence of a value means absent. Testing the value itself made
|
|
8
|
+
// `false`, `0` and `''` indistinguishable from unset, so they could never
|
|
9
|
+
// be written and came back as undefined.
|
|
10
|
+
if (value !== undefined && value !== null) {
|
|
8
11
|
builder.writeInt8(1);
|
|
9
12
|
spec.serialize(value, builder);
|
|
10
13
|
}
|
|
@@ -7,7 +7,10 @@ exports.IOptional = void 0;
|
|
|
7
7
|
const IOptional = (spec) => {
|
|
8
8
|
return {
|
|
9
9
|
serialize(value, builder) {
|
|
10
|
-
|
|
10
|
+
// Only the absence of a value means absent. Testing the value itself made
|
|
11
|
+
// `false`, `0` and `''` indistinguishable from unset, so they could never
|
|
12
|
+
// be written and came back as undefined.
|
|
13
|
+
if (value !== undefined && value !== null) {
|
|
11
14
|
builder.writeInt8(1);
|
|
12
15
|
spec.serialize(value, builder);
|
|
13
16
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.27.1-
|
|
4
|
+
"version": "7.27.1-33755622021.commit-da82bfb",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/ecs/issues",
|
|
7
7
|
"files": [
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"dependencies": {},
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"typings": "./dist/index.d.ts",
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "da82bfb0c7b437a9410e353b085ed08ad81aeff4"
|
|
38
38
|
}
|