@autofleet/shtinker 1.1.6-beta.15 → 1.1.6-beta.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.
@@ -22,13 +22,16 @@ const getAuditContext = () => {
22
22
  return auditContext;
23
23
  };
24
24
  const isEmpty = (field) => {
25
+ if (field == null) {
26
+ return true;
27
+ }
25
28
  if (Array.isArray(field)) {
26
29
  return field.length === 0;
27
30
  }
28
31
  if (typeof field === 'object') {
29
32
  return Object.keys(field).length === 0;
30
33
  }
31
- return field == null;
34
+ return false;
32
35
  };
33
36
  const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)));
34
37
  const getChangedFields = (instance, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "1.1.6-beta.15",
3
+ "version": "1.1.6-beta.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -13,13 +13,16 @@ const getAuditContext = () => {
13
13
  };
14
14
 
15
15
  const isEmpty = (field) => {
16
+ if (field == null) {
17
+ return true;
18
+ }
16
19
  if (Array.isArray(field)) {
17
20
  return field.length === 0;
18
21
  }
19
22
  if (typeof field === 'object') {
20
23
  return Object.keys(field).length === 0;
21
24
  }
22
- return field == null;
25
+ return false;
23
26
  }
24
27
 
25
28
  const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)));