@autofleet/shtinker 1.1.6-beta.11 → 1.1.6-beta.12

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,21 +22,21 @@ const getAuditContext = () => {
22
22
  return auditContext;
23
23
  };
24
24
  const isEmpty = (value) => {
25
- return Array.isArray(value) ? value.length === 0 : value === null;
25
+ return Array.isArray(value) ? value.length === 0 : value == null;
26
26
  };
27
- const isPropertyNotEmpty = (property, instance) => !isEmpty(instance.previous(property)) || !isEmpty(instance.get(property));
27
+ const isPropertyNotEmpty = (property, instance) => { return !isEmpty(instance.previous(property)) || !isEmpty(instance.get(property)); };
28
28
  const getChangedFields = (instance, options) => {
29
29
  logger_1.default.info('START getChangedFields');
30
30
  // When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
31
31
  // It's a known issut with sequelize.
32
32
  if (options.returning) {
33
- const nonEmptyChangedFields = options.fields.filter((property) => isPropertyNotEmpty(property, instance));
33
+ const nonEmptyChangedFields = options.fields.filter(property => isPropertyNotEmpty(property, instance));
34
34
  logger_1.default.info('BULK UPDATING', { options, nonEmptyChangedFields });
35
35
  return nonEmptyChangedFields;
36
36
  }
37
37
  const changedProperties = instance.changed();
38
38
  logger_1.default.info('changedProperties: ', { changedProperties });
39
- const nonEmptyChangedProperties = changedProperties.filter((property) => isPropertyNotEmpty(property, instance));
39
+ const nonEmptyChangedProperties = changedProperties.filter(property => isPropertyNotEmpty(property, instance));
40
40
  logger_1.default.info('nonEmptyChangedProperties: ', { nonEmptyChangedProperties });
41
41
  return nonEmptyChangedProperties;
42
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/shtinker",
3
- "version": "1.1.6-beta.11",
3
+ "version": "1.1.6-beta.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -13,23 +13,23 @@ const getAuditContext = () => {
13
13
  };
14
14
 
15
15
  const isEmpty = (value) => {
16
- return Array.isArray(value) ? value.length === 0 : value === null;
16
+ return Array.isArray(value) ? value.length === 0 : value == null;
17
17
  };
18
18
 
19
- const isPropertyNotEmpty = (property, instance) => !isEmpty(instance.previous(property)) || !isEmpty(instance.get(property));
19
+ const isPropertyNotEmpty = (property, instance) => { return !isEmpty(instance.previous(property)) || !isEmpty(instance.get(property)) };
20
20
 
21
21
  const getChangedFields = (instance, options) => {
22
22
  logger.info('START getChangedFields');
23
23
  // When bulk updating in sequelize using the "returning" option, the instance.changed() stops working.
24
24
  // It's a known issut with sequelize.
25
25
  if (options.returning) {
26
- const nonEmptyChangedFields = options.fields.filter((property) => isPropertyNotEmpty(property, instance));
26
+ const nonEmptyChangedFields = options.fields.filter(property => isPropertyNotEmpty(property, instance));
27
27
  logger.info('BULK UPDATING', { options, nonEmptyChangedFields });
28
28
  return nonEmptyChangedFields;
29
29
  }
30
30
  const changedProperties = instance.changed();
31
31
  logger.info('changedProperties: ', { changedProperties });
32
- const nonEmptyChangedProperties = changedProperties.filter((property) => isPropertyNotEmpty(property, instance));
32
+ const nonEmptyChangedProperties = changedProperties.filter(property => isPropertyNotEmpty(property, instance));
33
33
  logger.info('nonEmptyChangedProperties: ', { nonEmptyChangedProperties });
34
34
  return nonEmptyChangedProperties;
35
35
  };