@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.
- package/dist/audit-logger.js +4 -1
- package/package.json +1 -1
- package/src/audit-logger.ts +4 -1
package/dist/audit-logger.js
CHANGED
|
@@ -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
|
|
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
package/src/audit-logger.ts
CHANGED
|
@@ -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
|
|
25
|
+
return false;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
const filterOutEmptyFields = (fields, instance) => fields.filter(field => !isEmpty(instance.previous(field)) || !isEmpty(instance.get(field)));
|