TAdvMemo with JSONStyler

Auto Formating a JSON Tesxt works only with .Lines.LoadFromFile
.Lines.Add or .Lines.LoadFromStream don't format the JSON String

is there a function ( Format JSON ) to call at runtime ?

JSON-String : {"loginType":"Internal","nonce":"tu0c35ibvu766na8v0g3rhbji1","secret":"0011:269feba .."}

{
"loginType":"Internal",
"nonce":"8b5vdhdf20t3s3ab9jd0h4gf13",
"secret":"0011:692f9606df74bd1b813..."
}

I'm using this home-made function:

FUNCTION NiceJSON(CONST S : STRING ; IndentSize : Cardinal = 2) : STRING; 
  VAR
    J   : TJSONValue;

  BEGIN
    J:=TJSONObject.ParseJSONValue(S);
    TRY
      Result:=J.Format(IndentSize)
    FINALLY
      FreeAndNIL(J)
    END
  END;

There is the public method AdvMemo.Format you can call.

Also, we have the TTMSFNCWXJSONFormatter: