@lucaapp/service-utils 5.5.0 → 5.5.1

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.
@@ -162,9 +162,11 @@ class Money {
162
162
  exports.Money = Money;
163
163
  const moneyfiedGet = (model, key) => {
164
164
  const currentValue = model.getDataValue(key);
165
- return currentValue === null || currentValue === undefined
166
- ? null
167
- : Money.fromAmount(currentValue, model.getDataValue('currency'));
165
+ const currency = model.getDataValue('currency');
166
+ if (currentValue === null || currentValue === undefined || !currency) {
167
+ return null;
168
+ }
169
+ return Money.fromAmount(currentValue, currency);
168
170
  };
169
171
  exports.moneyfiedGet = moneyfiedGet;
170
172
  const moneyfiedSet = (model, key, value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [