Body, Mind & Soul — API Reference
    Preparing search index...
    • Convert a legacy condition/outcome value string into the config object shape.

      A string that parses as a plain JSON object becomes that object (the shape the config dialogs wrote for multi-field types such as valueMatches). Anything else, including empty strings, JSON scalars and arrays, is kept verbatim under value.

      Config: raw is the stored legacy string (any non-string is coerced by JSON.parse).

      Parameters

      • raw: string

        Legacy value string as stored on a condition or sub-condition.

      Returns object

      The config object to store: the parsed JSON object, or { value: raw }.

      legacyValueToConfig('{"lhs":"hookArgs.1.applied","op":">=","rhs":"3"}');
      // => { lhs: "hookArgs.1.applied", op: ">=", rhs: "3" }
      legacyValueToConfig("friendly");
      // => { value: "friendly" }