Skip to content
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
9 changes: 9 additions & 0 deletions src/Kuddle.Net/Serialization/KdlValueConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public static bool TryFromKdl(KdlValue kdlValue, Type targetType, out object? va
return kdlValue.TryGetTimeOnly(out var to1) && (value = to1) is not null;
if (underlying == typeof(TimeSpan))
return kdlValue.TryGetTimeSpan(out var ts) && (value = ts) is not null;

//4. AST
if (underlying == typeof(KdlValue))
{
value = kdlValue;
return true;
}


return false;
}
Expand Down Expand Up @@ -89,6 +97,7 @@ public static bool TryToKdl(object? input, out KdlValue kdlValue, string? typeAn
TimeOnly t => KdlValue.From(t),
TimeSpan ts => KdlValue.From(ts),
Enum e => KdlValue.From(e),
KdlValue kv => kv,
_ => null!,
};

Expand Down