mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
33 lines
951 B
TypeScript
33 lines
951 B
TypeScript
import * as R from 'ramda';
|
|
import { IBalanceSheetDataNode, IBalanceSheetSchemaNode } from '@/interfaces';
|
|
|
|
export const BalanceSheetBase = (Base) =>
|
|
class extends Base {
|
|
/**
|
|
* Detarmines the node type of the given schema node.
|
|
* @param {IBalanceSheetStructureSection} node -
|
|
* @param {string} type -
|
|
* @return {boolean}
|
|
*/
|
|
protected isSchemaNodeType = R.curry(
|
|
(type: string, node: IBalanceSheetSchemaNode): boolean => {
|
|
return node.type === type;
|
|
}
|
|
);
|
|
|
|
isNodeType = R.curry(
|
|
(type: string, node: IBalanceSheetDataNode): boolean => {
|
|
return node.nodeType === type;
|
|
}
|
|
);
|
|
|
|
/**
|
|
* Detarmines the given display columns by type.
|
|
* @param {string} displayColumnsBy
|
|
* @returns {boolean}
|
|
*/
|
|
protected isDisplayColumnsBy = (displayColumnsBy: string): boolean => {
|
|
return this.query.displayColumnsType === displayColumnsBy;
|
|
};
|
|
};
|