mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
7
packages/server/src/utils/accum-sum.ts
Normal file
7
packages/server/src/utils/accum-sum.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
export const accumSum = (data: any[], callback: (data: any) => number): number => {
|
||||
return data.reduce((acc, _data) => {
|
||||
const amount = callback(_data);
|
||||
return acc + amount;
|
||||
}, 0);
|
||||
};
|
||||
Reference in New Issue
Block a user