diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-04 02:16:40 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-04 02:16:40 +0200 |
commit | 1d02d9d76d987b69ed08a252a3fa66f7d05a4cbc (patch) | |
tree | 27314b621fa27045dcb375da9df9fde374d3c69d /LibMatrix/Extensions/ObjectExtensions.cs | |
parent | Code cleanup (diff) | |
download | LibMatrix-1d02d9d76d987b69ed08a252a3fa66f7d05a4cbc.tar.xz |
Clean up some extension functions
Diffstat (limited to '')
-rw-r--r-- | LibMatrix/Extensions/ObjectExtensions.cs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/LibMatrix/Extensions/ObjectExtensions.cs b/LibMatrix/Extensions/ObjectExtensions.cs deleted file mode 100644 index 085de7d..0000000 --- a/LibMatrix/Extensions/ObjectExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Text.Encodings.Web; -using System.Text.Json; - -namespace LibMatrix.Extensions; - -public static class ObjectExtensions { - public static string ToJson(this object obj, bool indent = true, bool ignoreNull = false, bool unsafeContent = false) { - var jso = new JsonSerializerOptions(); - if (indent) jso.WriteIndented = true; - if (ignoreNull) jso.IgnoreNullValues = true; - if (unsafeContent) jso.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping; - return JsonSerializer.Serialize(obj, jso); - } -} |