package pl.firmatpp.kierowca.domain

object PhoneNumberFormatter {
    fun normalize(input: String): String {
        var digits = input.filter(Char::isDigit)
        if (digits.startsWith("00")) digits = digits.drop(2)
        if (digits.length == 9) digits = "48$digits"
        return digits
    }

    fun mask(normalized: String): String = "+48 *** *** ${normalized.takeLast(3)}"
}
