Yokan / rebuild
Course 1 8624561

PrivateNotes.kt

composeApp/src/commonMain/kotlin/eu/friedcutlet/yokan/domain/PrivateNotes.kt

implementation11 lines
1package eu.friedcutlet.yokan.domain23/** Retain both texts, without duplicating an unchanged note on a repeated import/migration. */4fun mergePrivateNotes(existing: String, incoming: String): String {5    val separator = "\n\n---\n\n"6    return when {7        incoming.isEmpty() || existing == incoming || existing.endsWith(separator + incoming) -> existing8        existing.isEmpty() -> incoming9        else -> existing + separator + incoming10    }11}12

Search chapters, reference and source filenames.