using Newtonsoft.Json;

namespace Symphonia.Core.Utils {
  public class JsonUtil {
    private static JsonSerializerSettings ignoreNullValue = new JsonSerializerSettings {
      NullValueHandling = NullValueHandling.Ignore
    };

    public static string Encode(object value) => JsonConvert.SerializeObject(value, ignoreNullValue);
    public static T Decode<T>(string value) => JsonConvert.DeserializeObject<T>(value);
  }
}