asv-hlps 1.3.69 → 1.3.70
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/lib/cjs/utils.js +4 -2
- package/lib/esm/utils.js +4 -2
- package/package.json +1 -1
package/lib/cjs/utils.js
CHANGED
|
@@ -653,13 +653,15 @@ const fillEndWithZero = (num, targetLength) => {
|
|
|
653
653
|
exports.fillEndWithZero = fillEndWithZero;
|
|
654
654
|
const sumAmount = (tobs, property) => {
|
|
655
655
|
return tobs.reduce((prev, curr) => {
|
|
656
|
-
|
|
656
|
+
if (curr && curr[property] !== null) {
|
|
657
|
+
return +prev + +curr[property];
|
|
658
|
+
}
|
|
657
659
|
}, 0);
|
|
658
660
|
};
|
|
659
661
|
exports.sumAmount = sumAmount;
|
|
660
662
|
const reduceSum = (tobs, property) => {
|
|
661
663
|
return tobs.reduce((prev, curr) => {
|
|
662
|
-
if (curr) {
|
|
664
|
+
if (curr && curr[property] !== null) {
|
|
663
665
|
return +prev + +curr[property];
|
|
664
666
|
}
|
|
665
667
|
}, 0);
|
package/lib/esm/utils.js
CHANGED
|
@@ -580,12 +580,14 @@ export const fillEndWithZero = (num, targetLength) => {
|
|
|
580
580
|
};
|
|
581
581
|
export const sumAmount = (tobs, property) => {
|
|
582
582
|
return tobs.reduce((prev, curr) => {
|
|
583
|
-
|
|
583
|
+
if (curr && curr[property] !== null) {
|
|
584
|
+
return +prev + +curr[property];
|
|
585
|
+
}
|
|
584
586
|
}, 0);
|
|
585
587
|
};
|
|
586
588
|
export const reduceSum = (tobs, property) => {
|
|
587
589
|
return tobs.reduce((prev, curr) => {
|
|
588
|
-
if (curr) {
|
|
590
|
+
if (curr && curr[property] !== null) {
|
|
589
591
|
return +prev + +curr[property];
|
|
590
592
|
}
|
|
591
593
|
}, 0);
|