using System.Text.Json;
namespace Umbraco.Cms.Infrastructure.Serialization;
///
/// Converts a string to or from JSON, interning the string when reading.
///
public sealed class JsonStringInternConverter : ReadOnlyJsonConverter
{
///
public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> reader.GetString() is string value
? string.Intern(value)
: null;
}