Body, Mind & Soul — API Reference
    Preparing search index...

    Function readConditionConfigValue

    • Read the string a condition config dialog pre-fills from, given a stored condition.

      Conditions persist their user-supplied values in config (an object). The dialog builders in _buildConditionConfigContent still parse a string, so this maps the object back to that string form:

      • A legacy raw value string (unmigrated data) is returned as-is.
      • A config whose only key is value returns that scalar ({ value: "friendly" } → "friendly").
      • Any other non-empty config is returned as JSON, which the multi-field builders parse.
      • An empty or missing config returns "".

      Config: none (reads condition.value and condition.config only).

      Parameters

      • condition: object | null | undefined

        A TriggerConditionModel or plain condition/sub-condition object ({ type, config?, value? }).

      Returns string

      The string the dialog builder should parse or display; "" when nothing is stored.

      readConditionConfigValue({ type: "valueMatches", config: { lhs: "a", op: ">=", rhs: "2" } });
      // => '{"lhs":"a","op":">=","rhs":"2"}'
      readConditionConfigValue({ type: "disposition", config: { value: "hostile" } });
      // => "hostile"