<commit_before>package japgolly.scalajs.react

import scalajs.js
import japgolly.scalajs.react.{raw => Raw}

object PropsChildren {
  def apply(c: js.UndefOr[Raw.PropsChildren]): PropsChildren =
    new PropsChildren(c.asInstanceOf[js.Any])

  def fromRawProps(p: js.Object): PropsChildren = {
    val pp = p.asInstanceOf[js.UndefOr[Raw.PropsWithChildren]]
    apply(pp.map(_.children))
  }
}

final class PropsChildren private[PropsChildren](private val self: js.Any) extends AnyVal {
  def raw: Raw.PropsChildren =
    self.asInstanceOf[Raw.PropsChildren]

  override def toString: String =
    iterator.mkString("PropsChildren(", ", ", ")")

//    /** Invoke fn on every immediate child contained within children with this set to context. If children is a nested object or array it will be traversed: fn will never be passed the container objects. If children is null or undefined returns null or undefined rather than an empty object. */
//    def map(c: PropsChildren, fn: MapFn): js.UndefOr[js.Object] = js.native
//
//    /** Like React.Children.map() but does not return an object. */
//    def forEach(c: PropsChildren, fn: MapFn): Unit = js.native

  /** Return the only child in children. Throws otherwise. */
  def only(): Raw.ReactNode =
    Raw.React.Children.only(raw)

  /** Return the total number of components in children, equal to the number of times that a callback passed to map or forEach would be invoked. */
  def count: Int =
    Raw.React.Children.count(raw)

  def isEmpty: Boolean =
    count == 0

  @inline def nonEmpty: Boolean =
    !isEmpty

  def iterator: Iterator[Raw.ReactNode] =
    toJsArray.iterator

  /** Return the children opaque data structure as a flat array with keys assigned to each child. Useful if you want to manipulate collections of children in your render methods, especially if you want to reorder or slice this.props.children before passing it down. */
  def toJsArray: js.Array[Raw.ReactNode] =
    Raw.React.Children.toArray(raw)

  def toSeq: Seq[Raw.ReactNode] =
    toJsArray
}
<commit_msg>Replace PropsChildren#toSeq with to{List,Vector}<commit_after>package japgolly.scalajs.react

import scalajs.js
import japgolly.scalajs.react.{raw => Raw}

object PropsChildren {
  def apply(c: js.UndefOr[Raw.PropsChildren]): PropsChildren =
    new PropsChildren(c.asInstanceOf[js.Any])

  def fromRawProps(p: js.Object): PropsChildren = {
    val pp = p.asInstanceOf[js.UndefOr[Raw.PropsWithChildren]]
    apply(pp.map(_.children))
  }
}

final class PropsChildren private[PropsChildren](private val self: js.Any) extends AnyVal {
  def raw: Raw.PropsChildren =
    self.asInstanceOf[Raw.PropsChildren]

  override def toString: String =
    iterator.mkString("PropsChildren(", ", ", ")")

//    /** Invoke fn on every immediate child contained within children with this set to context. If children is a nested object or array it will be traversed: fn will never be passed the container objects. If children is null or undefined returns null or undefined rather than an empty object. */
//    def map(c: PropsChildren, fn: MapFn): js.UndefOr[js.Object] = js.native
//
//    /** Like React.Children.map() but does not return an object. */
//    def forEach(c: PropsChildren, fn: MapFn): Unit = js.native

  /** Return the only child in children. Throws otherwise. */
  def only(): Raw.ReactNode =
    Raw.React.Children.only(raw)

  /** Return the total number of components in children, equal to the number of times that a callback passed to map or forEach would be invoked. */
  def count: Int =
    Raw.React.Children.count(raw)

  def isEmpty: Boolean =
    count == 0

  @inline def nonEmpty: Boolean =
    !isEmpty

  def iterator: Iterator[Raw.ReactNode] =
    toJsArray.iterator

  /** Return the children opaque data structure as a flat array with keys assigned to each child. Useful if you want to manipulate collections of children in your render methods, especially if you want to reorder or slice this.props.children before passing it down. */
  def toJsArray: js.Array[Raw.ReactNode] =
    Raw.React.Children.toArray(raw)

  def toList: List[Raw.ReactNode] =
    iterator.toList

  def toVector: Vector[Raw.ReactNode] =
    iterator.toVector
}

{'fraction_non_alphanumeric': 0.099002849002849, 'fraction_numerical': 0.0004748338081671415, 'mean_word_length': 3.76045197740113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3107941', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1245, 'n_words': 441}