dtable-utils
Version:
dtable common utils
35 lines (29 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('./core.js');
var cellType = require('../constants/cell-type.js');
var column = require('../constants/column.js');
/**
* Check whether is numeric column:
* - column type is number, duration or rate etc.
* - column type is formula and result_type is number
* - column type is link/link_formula and array_type is number, duration or rate etc.
* @param {object} column e.g. { type, data }
* @returns true/false, bool
*/
var isNumericColumn = function isNumericColumn(column$1) {
return column.NUMERIC_COLUMNS_TYPES.includes(core.getColumnType(column$1));
};
/**
* Check whether is number column:
* - column type is number
* - column type is formula and result_type is number
* - column type is link/link_formula and array_type is number
* @param {object} column e.g. { type, data }
* @returns true/false, bool
*/
var isNumberColumn = function isNumberColumn(column) {
return core.getColumnType(column) === cellType.CellType.NUMBER;
};
exports.isNumberColumn = isNumberColumn;
exports.isNumericColumn = isNumericColumn;