mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: payment receive and made form.
This commit is contained in:
@@ -262,3 +262,15 @@ export const flatToNestedArray = (
|
||||
export const orderingLinesIndexes = (lines, attribute = 'index') => {
|
||||
return lines.map((line, index) => ({ ...line, [attribute]: index + 1 }));
|
||||
};
|
||||
|
||||
|
||||
export const transformToObject = (arr, key) => {
|
||||
return arr.reduce(function(acc, cur, i) {
|
||||
acc[key ? cur[key] : i] = cur;
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
export const itemsStartWith = (items, char) => {
|
||||
return items.filter((item) => item.indexOf(char) === 0);
|
||||
};
|
||||
Reference in New Issue
Block a user