UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

15 lines (14 loc) 597 B
import * as C from "../../../i18n/constants.mjs"; import { registerOperation } from "../logicalOperationRegisterer.mjs"; export const OPERATION_ID = 'disjunction'; export const SHORT_NAME_FOR_COMPONENT = C.FILTERS_LABELS_DISJUNCTION; // (p OR q OR w OR x OR...) === TRUE? /** * @param {Array} conditions An array with values to check. * @param {*} value The comparable value. * @returns {boolean} */ export function operationResult(conditions, value) { return conditions.some(condition => condition.func(value)); } registerOperation(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult);