Skip to content

Commit accedb6

Browse files
committed
Update js-utils.md
1 parent c88afbd commit accedb6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

MyApp/_pages/js-utils.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ C# Pattern matching provides a powerful and intuitive approach for introspecting
3535

3636
```csharp
3737
var comfyOutput = JSON.ParseObject(json);
38-
var prompt = (Dictionary<string, object?>)result.Values.First()!;
39-
if (prompt.TryGetValue("prompt", out List<object> promptTuple) && promptTuple.Count > 3)
38+
if (prompt.TryGetValue("prompt", out List<object> tuple) && tuple.Count > 3)
4039
{
41-
var extraData = promptTuple[3];
42-
if (extraData is Dictionary<string, object?> extraDataDict
43-
&& extraDataDict.TryGetValue("client_id", out string clientId))
40+
if (tuple[3] is Dictionary<string, object?> extraData
41+
&& extraData.TryGetValue("client_id", out string clientId))
4442
{
4543
Console.WriteLine(clientId);
4644
}

0 commit comments

Comments
 (0)