Variable ResultTemplatesHelpersConst

ResultTemplatesHelpers: {
    fieldMustMatch: ((fieldName: string, valuesToMatch: string[]) => ResultTemplateCondition);
    fieldMustNotMatch: ((fieldName: string, blacklistedValues: string[]) => ResultTemplateCondition);
    fieldsMustBeDefined: ((fieldNames: string[]) => ResultTemplateCondition);
    fieldsMustNotBeDefined: ((fieldNames: string[]) => ResultTemplateCondition);
    getResultProperty: ((result: Result, property: string) => unknown);
} = ...

Type declaration

  • fieldMustMatch: ((fieldName: string, valuesToMatch: string[]) => ResultTemplateCondition)
      • (fieldName, valuesToMatch): ResultTemplateCondition
      • Creates a condition that verifies if a field's value contains any of the specified values.

        Parameters

        • fieldName: string

          (string) The name of the field to check.

        • valuesToMatch: string[]

          (string[]) A list of possible values to match.

        Returns ResultTemplateCondition

        (ResultTemplateCondition) A function that takes a result and checks if the value for the specified field matches any value in the specified list.

  • fieldMustNotMatch: ((fieldName: string, blacklistedValues: string[]) => ResultTemplateCondition)
      • (fieldName, blacklistedValues): ResultTemplateCondition
      • Creates a condition that verifies that a field's value does not contain any of the specified values.

        Parameters

        • fieldName: string

          (string) The name of the field to check.

        • blacklistedValues: string[]

          (string[]) A list of all disallowed values.

        Returns ResultTemplateCondition

        (ResultTemplateCondition) A function that takes a result and checks that the value for the specified field does not match any value in the given list.

  • fieldsMustBeDefined: ((fieldNames: string[]) => ResultTemplateCondition)
      • (fieldNames): ResultTemplateCondition
      • Creates a condition that verifies if the specified fields are defined.

        Parameters

        • fieldNames: string[]

          (string[]) A list of fields that must be defined.

        Returns ResultTemplateCondition

        (ResultTemplateCondition) A function that takes a result and checks if every field in the specified list is defined.

  • fieldsMustNotBeDefined: ((fieldNames: string[]) => ResultTemplateCondition)
      • (fieldNames): ResultTemplateCondition
      • Creates a condition that verifies if the specified fields are not defined.

        Parameters

        • fieldNames: string[]

          (string[]) A list of fields that must not be defined.

        Returns ResultTemplateCondition

        (ResultTemplateCondition) A function that takes a result and checks if every field in the specified list is not defined.

  • getResultProperty: ((result: Result, property: string) => unknown)
      • (result, property): unknown
      • Extracts a property from a result object.

        Parameters

        • result: Result

          (Result) The target result.

        • property: string

          (string) The property to extract.

        Returns unknown

        (unknown) The value of the specified property in the specified result, or null if the property does not exist.