<commit_before>package akka.viz.serialization.serializers

import akka.actor.ActorRef
import akka.viz.serialization.{MessageSerialization, AkkaVizSerializer}
import upickle.Js

case object OptionSerializer extends AkkaVizSerializer {
  override def serialize(obj: Any): Js.Value = {
    obj match {
      case Some(x) => Js.Obj("$type" -> MessageSerialization.serialize(x))
      case None => Js.Obj("$type" -> Js.Str(s"scala.util.None"))
    }
  }

  override def canSerialize(obj: Any): Boolean = obj match {
    case t: Option[_] => true
    case _ => false
  }
}

<commit_msg>For Some, return internal object immediatelly<commit_after>package akka.viz.serialization.serializers

import akka.actor.ActorRef
import akka.viz.serialization.{MessageSerialization, AkkaVizSerializer}
import upickle.Js

case object OptionSerializer extends AkkaVizSerializer {
  override def serialize(obj: Any): Js.Value = {
    obj match {
      case Some(x) => MessageSerialization.serialize(x)
      case None => Js.Obj("$type" -> Js.Str(s"scala.util.None"))
    }
  }

  override def canSerialize(obj: Any): Boolean = obj match {
    case t: Option[_] => true
    case _ => false
  }
}


{'fraction_non_alphanumeric': 0.1184995737425405, 'fraction_numerical': 0.0, 'mean_word_length': 3.9745762711864407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '2147279', 'n_tokens_mistral': 382, 'n_tokens_neox': 382, 'n_words': 88}