Skip to content

Commit

Permalink
move path-spliting to PathSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
otakumesi committed Dec 19, 2023
1 parent 2b82097 commit df9b29a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import scala.collection.mutable.ArrayBuffer
case class PathSegment(tag: String, id: String, classes: Seq[String]) {
override def toString: String = classes
.mkString(tag + (if (classes.isEmpty) "" else "."), ".", if (id == null) "" else s"#$id")

def splitIdByCase: Seq[String] = id.split("[_-]")
def splitClassesByCase: Seq[Array[String]] = classes.map(_.split("[_-]"))
}

object PathSegment {
Expand Down

0 comments on commit df9b29a

Please sign in to comment.