mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 18:37:18 +02:00
17 lines
549 B
C#
17 lines
549 B
C#
using Newtonsoft.Json.Linq;
|
|
|
|
namespace WotBlitzStatisticsPro.Blazor.Helpers
|
|
{
|
|
public static class JTokenHelper
|
|
{
|
|
public static bool IsNullOrEmpty(this JToken token)
|
|
{
|
|
return (token == null) ||
|
|
(token.Type == JTokenType.Array && !token.HasValues) ||
|
|
(token.Type == JTokenType.Object && !token.HasValues) ||
|
|
(token.Type == JTokenType.String && token.ToString() == string.Empty) ||
|
|
(token.Type == JTokenType.Null);
|
|
}
|
|
}
|
|
}
|