atomic-field-condition

In this article

The atomic-field-condition component takes a list of conditions that, if fulfilled, apply the template in which it’s defined.

Properties

Property Attribute Description Type Default

conditions

A function that must return true on results for the result template to apply.

For example, a template with the following condition only applies to results whose title contains singapore: [(result) => /singapore/i.test(result.title)]

ResultTemplateCondition[]

[]

ifDefined

if-defined

Verifies wheter the specified fields are defined.

string | undefined

ifNotDefined

if-not-defined

Verifies whether the specified fields are not defined.

string | undefined

mustMatch

must-match

Creates a condition which verifies that a field’s value contains any of the specified values.

Record<string, string[]>

{}

mustNotMatch

must-not-match

Creates a condition which verifies that a field’s value doesn’t contain any of the specified values.

Record<string, string[]>

{}

What's next for me?