@stonyx/orm 0.2.1-beta.29 → 0.2.1-beta.30

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.2.1-beta.29",
7
+ "version": "0.2.1-beta.30",
8
8
  "description": "",
9
9
  "main": "src/main.js",
10
10
  "type": "module",
@@ -22,8 +22,8 @@ export default class ModelProperty {
22
22
  return this._value = newValue;
23
23
  }
24
24
 
25
- if (newValue === undefined || newValue === null) return;
25
+ if (newValue === undefined) return;
26
26
 
27
- this._value = Orm.instance.transforms[this.type](newValue);
27
+ this._value = newValue === null ? null : Orm.instance.transforms[this.type](newValue);
28
28
  }
29
29
  }
package/src/serializer.js CHANGED
@@ -71,8 +71,8 @@ export default class Serializer {
71
71
  const handler = model[key];
72
72
  const data = query(rawData, pathPrefix, subPath);
73
73
 
74
- // Ignore null/undefined values on updates (TODO: What if we want it set to null?)
75
- if ((data === null || data === undefined) && options.update) continue;
74
+ // Skip fields not present in the update payload (undefined = not provided)
75
+ if (data === undefined && options.update) continue;
76
76
 
77
77
  // Relationship handling
78
78
  if (typeof handler === 'function') {