mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-27 00:12:57 +00:00
Rework architecture
This commit is contained in:
12
DiscordChatExporter.Domain/Internal/JsonElementExtensions.cs
Normal file
12
DiscordChatExporter.Domain/Internal/JsonElementExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DiscordChatExporter.Domain.Internal
|
||||
{
|
||||
internal static class JsonElementExtensions
|
||||
{
|
||||
public static JsonElement? GetPropertyOrNull(this JsonElement element, string propertyName) =>
|
||||
element.TryGetProperty(propertyName, out var result) && result.ValueKind != JsonValueKind.Null
|
||||
? result
|
||||
: (JsonElement?) null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user