<commit_before>﻿using Jil;

namespace Elephanet.Serialization
{
    public class JilJsonConverter : IJsonConverter
    {
        private readonly Options _options;
        public JilJsonConverter()
        {
            _options = new Options(includeInherited: true);
        }

        public string Serialize<T>(T entity)
        {
            
            return JSON.Serialize<T>(entity,_options);
        }

        public T Deserialize<T>(string json)
        {
            return JSON.Deserialize<T>(json);
        }

        public object Deserialize(string json)
        {
            return JSON.DeserializeDynamic(json);
        }

        public object Deserialize(string json, System.Type type)
        {
            return JSON.Deserialize(json, type);
        }
    }
}<commit_msg>use options in all calls of serializer and set dateformat to ISO8601 (a better default IMO)<commit_after>﻿using Jil;

namespace Elephanet.Serialization
{
    public class JilJsonConverter : IJsonConverter
    {
        private readonly Options _options;
        public JilJsonConverter()
        {
            _options = new Options(includeInherited: true, dateFormat:DateTimeFormat.ISO8601);
        }

        public string Serialize<T>(T entity)
        {
            
            return JSON.Serialize<T>(entity,_options);
        }

        public T Deserialize<T>(string json)
        {
            return JSON.Deserialize<T>(json,_options);
        }

        public object Deserialize(string json)
        {
            return JSON.DeserializeDynamic(json, _options);
        }

        public object Deserialize(string json, System.Type type)
        {
            return JSON.Deserialize(json, type,_options);
        }
    }
}
{'fraction_non_alphanumeric': 0.07963069821119446, 'fraction_numerical': 0.004616272360069244, 'mean_word_length': 1.9540034071550256, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '663148', 'n_tokens_mistral': 458, 'n_tokens_neox': 447, 'n_words': 107}