Skip to content

Commit

Permalink
(#41) Adds asAnyElement for List<IonElement> (#148)
Browse files Browse the repository at this point in the history
* (#41) Adds asAnyElement for List<IonElement>

* Adds explicit return type
  • Loading branch information
RCHowell authored May 11, 2023
1 parent 26645c2 commit b7beeea
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ val List<AnyElement>.head: AnyElement

/** Returns a copy of the list with the first element removed. */
val List<AnyElement>.tail: List<AnyElement> get() = this.subList(1, this.size)

/**
* Returns a copy of the list with each element as AnyElement
*/
fun List<IonElement>.asAnyElement(): List<AnyElement> = this.map { it.asAnyElement() }

0 comments on commit b7beeea

Please sign in to comment.