mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import * as R from 'ramda';
|
||||
import { TOTAL_NODE_TYPES } from './constants';
|
||||
|
||||
export const ProfitLossSheetBase = (Base) =>
|
||||
class extends Base {
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param node
|
||||
* @returns
|
||||
*/
|
||||
public isNodeType = R.curry((type: string, node) => {
|
||||
return node.nodeType === type;
|
||||
});
|
||||
|
||||
protected isNodeTypeIn = R.curry((types: string[], node) => {
|
||||
return types.indexOf(node.nodeType) !== -1;
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected findNodeById = R.curry((id, nodes) => {
|
||||
return this.findNodeDeep(nodes, (node) => node.id === id);
|
||||
});
|
||||
|
||||
isNodeTotal = (node) => {
|
||||
return this.isNodeTypeIn(TOTAL_NODE_TYPES, node);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user