Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with dotnet-format #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Caching/JsoGetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static class JsoGetter
.GetValue(null) as ConditionalWeakTable<Jso, object>)!;

static object ToContainer(this ConditionalWeakTable<Jso, object> all)
=> typeof(ConditionalWeakTable<Jso,object>).GetRuntimeFields().First(f => f.FieldType.Name == ContainerName).GetValue(all);
=> typeof(ConditionalWeakTable<Jso, object>).GetRuntimeFields().First(f => f.FieldType.Name == ContainerName).GetValue(all);

static IEnumerable ToEntries(this object container)
=> (container.GetType().GetRuntimeFields().First(f => f.Name.Contains(entriesName)).GetValue(container) as IEnumerable)!;
Expand All @@ -46,22 +46,22 @@ static object ToDependentHandle(this object entry)
static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> ts)
=> ts.Where(t => t is not null)!;

static readonly Jso DefaultJso = new()
{
AllowTrailingCommas = true,
MaxDepth = 10,
DefaultIgnoreCondition = JIgnore.Never,
ReferenceHandler = ReferenceHandler.Preserve,
UnmappedMemberHandling = JsonUnmappedMemberHandling.Skip,
NumberHandling =
JNumbers.AllowNamedFloatingPointLiterals | JNumbers.AllowReadingFromString,
DictionaryKeyPolicy = JNaming.CamelCase,
UnknownTypeHandling = JUnknownTypes.JsonElement,
WriteIndented = false,
IgnoreReadOnlyFields = false,
PropertyNameCaseInsensitive = true,
ReadCommentHandling = JComments.Skip
};
static readonly Jso DefaultJso = new()
{
AllowTrailingCommas = true,
MaxDepth = 10,
DefaultIgnoreCondition = JIgnore.Never,
ReferenceHandler = ReferenceHandler.Preserve,
UnmappedMemberHandling = JsonUnmappedMemberHandling.Skip,
NumberHandling =
JNumbers.AllowNamedFloatingPointLiterals | JNumbers.AllowReadingFromString,
DictionaryKeyPolicy = JNaming.CamelCase,
UnknownTypeHandling = JUnknownTypes.JsonElement,
WriteIndented = false,
IgnoreReadOnlyFields = false,
PropertyNameCaseInsensitive = true,
ReadCommentHandling = JComments.Skip
};

/// <summary>We're going to assume that the JSO that we want was the first one added to this collection, at startup</summary>
public static Jso GetJso()
Expand Down
Loading