Skip to content

Commit

Permalink
f - Oppdaterer vasking av mulig fnummer
Browse files Browse the repository at this point in the history
Co-authored-by: Mariam Pervez <[email protected]>
  • Loading branch information
dskarpas and MariamPervez committed Nov 16, 2023
1 parent 3f0a29b commit 39e1974
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ class Fodselsnummer private constructor(@JsonValue val value: String) {
}
}

fun vask11sifre(tekst: String) = tekst.replace(Regex("""\b\d{11}\b"""), "***")
fun vask11sifre(nummer: String?): String {
return if(nummer.isNullOrBlank() || nummer.length != 11) ""
else {
nummer.replace(Regex("""\b\d{11}\b"""), "***")
}
}

fun fraMedValidation(fnr: String?): Fodselsnummer? {
return try {
Fodselsnummer(fnr!!.replace(Regex("[^0-9]"), ""))
Expand Down

0 comments on commit 39e1974

Please sign in to comment.