Skip to main content

processMatchMode()

processMatchMode(rule: RuleType): false | ProcessedMatchMode | null

Defined in: packages/core/src/utils/formatQuery/utils.ts:360

Transforms

  • match: { mode: "atLeast", threshold: 1 } to match: { mode: "some" }
  • match: { mode: "atMost", threshold: 0 } to match: { mode: "none" }.

Returns:

  • Processed { mode, threshold } object for valid subqueries
  • null if match mode is not applicable for the rule
  • false if match mode is valid, but either
    1. threshold is required and invalid, or
    2. value is not a valid rule group.

Parameters

ParameterType
ruleRuleType

Returns

false | ProcessedMatchMode | null


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.