@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.
- package/dist/lib/money/money.js +5 -3
- package/package.json +1 -1
package/dist/lib/money/money.js
CHANGED
|
@@ -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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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) => {
|