@umbraco-cms/backoffice
    Preparing search index...

    Function umbGetFirstJsonPathBracket

    • Extracts the contents of the first pair of square brackets in a JSON-Path string — the query of the outermost/first array-item scope, ignoring anything nested deeper in the path.

      Parameters

      • path: string

        The JSON-Path string.

      Returns string | undefined

      The bracket contents, or undefined if the path has no brackets.

      umbGetFirstJsonPathBracket("$.values[?(@.alias == 'x')].value.contentData[?(@.key == 'y')]");
      // => "?(@.alias == 'x')"